├── .github └── workflows │ ├── build.yml │ └── release.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── Makefile ├── README.md ├── config.toml ├── rustfmt.toml └── src ├── cef.rs └── lib.rs /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout repository 10 | uses: actions/checkout@v4 11 | - name: Run make 12 | run: make 13 | - name: Strip binary 14 | run: strip target/release/libspotifyadblock.so 15 | - name: Create build artifact 16 | uses: actions/upload-artifact@v4 17 | with: 18 | name: spotify-adblock.so 19 | path: target/release/libspotifyadblock.so 20 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | release: 5 | types: 6 | - created 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout repository 13 | uses: actions/checkout@v4 14 | - name: Run make 15 | run: make 16 | - name: Attach build artifact to release 17 | uses: actions/upload-release-asset@v1 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | with: 21 | upload_url: ${{ github.event.release.upload_url }} 22 | asset_name: spotify-adblock.so 23 | asset_path: target/release/libspotifyadblock.so 24 | asset_content_type: application/octet-stream 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | include/ 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "equivalent" 16 | version = "1.0.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 19 | 20 | [[package]] 21 | name = "hashbrown" 22 | version = "0.14.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" 25 | 26 | [[package]] 27 | name = "indexmap" 28 | version = "2.0.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" 31 | dependencies = [ 32 | "equivalent", 33 | "hashbrown", 34 | ] 35 | 36 | [[package]] 37 | name = "lazy_static" 38 | version = "1.4.0" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 41 | 42 | [[package]] 43 | name = "libc" 44 | version = "0.2.147" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 47 | 48 | [[package]] 49 | name = "memchr" 50 | version = "2.5.0" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 53 | 54 | [[package]] 55 | name = "proc-macro2" 56 | version = "1.0.66" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 59 | dependencies = [ 60 | "unicode-ident", 61 | ] 62 | 63 | [[package]] 64 | name = "quote" 65 | version = "1.0.31" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" 68 | dependencies = [ 69 | "proc-macro2", 70 | ] 71 | 72 | [[package]] 73 | name = "regex" 74 | version = "1.9.1" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" 77 | dependencies = [ 78 | "aho-corasick", 79 | "memchr", 80 | "regex-automata", 81 | "regex-syntax", 82 | ] 83 | 84 | [[package]] 85 | name = "regex-automata" 86 | version = "0.3.3" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" 89 | dependencies = [ 90 | "aho-corasick", 91 | "memchr", 92 | "regex-syntax", 93 | ] 94 | 95 | [[package]] 96 | name = "regex-syntax" 97 | version = "0.7.4" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" 100 | 101 | [[package]] 102 | name = "serde" 103 | version = "1.0.174" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1" 106 | dependencies = [ 107 | "serde_derive", 108 | ] 109 | 110 | [[package]] 111 | name = "serde_derive" 112 | version = "1.0.174" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e" 115 | dependencies = [ 116 | "proc-macro2", 117 | "quote", 118 | "syn", 119 | ] 120 | 121 | [[package]] 122 | name = "serde_regex" 123 | version = "1.1.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" 126 | dependencies = [ 127 | "regex", 128 | "serde", 129 | ] 130 | 131 | [[package]] 132 | name = "serde_spanned" 133 | version = "0.6.3" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" 136 | dependencies = [ 137 | "serde", 138 | ] 139 | 140 | [[package]] 141 | name = "spotify-adblock" 142 | version = "1.0.2" 143 | dependencies = [ 144 | "lazy_static", 145 | "libc", 146 | "regex", 147 | "serde", 148 | "serde_regex", 149 | "toml", 150 | ] 151 | 152 | [[package]] 153 | name = "syn" 154 | version = "2.0.27" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" 157 | dependencies = [ 158 | "proc-macro2", 159 | "quote", 160 | "unicode-ident", 161 | ] 162 | 163 | [[package]] 164 | name = "toml" 165 | version = "0.7.6" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" 168 | dependencies = [ 169 | "serde", 170 | "serde_spanned", 171 | "toml_datetime", 172 | "toml_edit", 173 | ] 174 | 175 | [[package]] 176 | name = "toml_datetime" 177 | version = "0.6.3" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" 180 | dependencies = [ 181 | "serde", 182 | ] 183 | 184 | [[package]] 185 | name = "toml_edit" 186 | version = "0.19.14" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" 189 | dependencies = [ 190 | "indexmap", 191 | "serde", 192 | "serde_spanned", 193 | "toml_datetime", 194 | "winnow", 195 | ] 196 | 197 | [[package]] 198 | name = "unicode-ident" 199 | version = "1.0.11" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 202 | 203 | [[package]] 204 | name = "winnow" 205 | version = "0.5.0" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" 208 | dependencies = [ 209 | "memchr", 210 | ] 211 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "spotify-adblock" 3 | version = "1.0.2" 4 | authors = ["abba23"] 5 | description = "Adblocker for Spotify" 6 | edition = "2021" 7 | 8 | [dependencies] 9 | lazy_static = "*" 10 | libc = "*" 11 | regex = "*" 12 | serde = { version = "*", features = ["derive"] } 13 | serde_regex = "*" 14 | toml = "*" 15 | 16 | [lib] 17 | name = "spotifyadblock" 18 | crate_type = ["cdylib"] 19 | 20 | [profile.release] 21 | lto = true 22 | opt-level = 3 23 | panic = "abort" 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME = spotify-adblock 2 | PREFIX = /usr/local 3 | PROFILE ?= release 4 | BINARY_PATH = target/$(PROFILE)/libspotifyadblock.so 5 | CONFIG_PATH = config.toml 6 | BINARY_TARGET = $(DESTDIR)$(PREFIX)/lib/$(NAME).so 7 | CONFIG_TARGET = $(DESTDIR)/etc/$(NAME)/config.toml 8 | 9 | .PHONY: all 10 | all: $(BINARY_PATH) 11 | 12 | $(BINARY_PATH): src Cargo.toml 13 | # cargo build --profile $(PROFILE) 14 | ifeq ($(PROFILE), release) 15 | cargo build --release 16 | else 17 | cargo build 18 | endif 19 | 20 | .PHONY: clean 21 | clean: 22 | rm -rf target 23 | 24 | .PHONY: install 25 | install: $(BINARY_PATH) $(CONFIG_PATH) 26 | install -D --mode=644 --strip $(BINARY_PATH) $(BINARY_TARGET) 27 | install -D --mode=644 $(CONFIG_PATH) $(CONFIG_TARGET) 28 | 29 | .PHONY: uninstall 30 | uninstall: 31 | rm -f $(BINARY_TARGET) 32 | rm -f $(CONFIG_TARGET) 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spotify-adblock 2 | Spotify adblocker for Linux (macOS untested) that works by wrapping `getaddrinfo` and `cef_urlrequest_create`. It blocks requests to domains that are not on the allowlist, as well as URLs that are on the denylist. 3 | 4 | ### Notes 5 | * This **does not** work with the snap Spotify package. 6 | * This **might not** work with the Flatpak Spotify package, depending on your system's shared libraries' versions. 7 | * On Debian-based distributions (e.g. Ubuntu), the Debian Spotify package can be installed by following the instructions at the bottom of [this page](https://www.spotify.com/us/download/linux/). *(recommended)* 8 | 9 | ## Build 10 | Prerequisites: 11 | * Git 12 | * Make 13 | * Rust 14 | * [Cargo](https://doc.rust-lang.org/cargo/) 15 | 16 | ```bash 17 | $ git clone https://github.com/abba23/spotify-adblock.git 18 | $ cd spotify-adblock 19 | $ make 20 | ``` 21 | 22 | ## Install 23 | ```bash 24 | $ sudo make install 25 | ``` 26 | 27 | #### Flatpak 28 | ```bash 29 | $ mkdir -p ~/.spotify-adblock && cp target/release/libspotifyadblock.so ~/.spotify-adblock/spotify-adblock.so 30 | $ mkdir -p ~/.var/app/com.spotify.Client/config/spotify-adblock && cp config.toml ~/.var/app/com.spotify.Client/config/spotify-adblock 31 | $ flatpak override --user --filesystem="~/.spotify-adblock/spotify-adblock.so" --filesystem="~/.config/spotify-adblock/config.toml" com.spotify.Client 32 | ``` 33 | 34 | ## Usage 35 | ### Command-line 36 | ```bash 37 | $ LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify 38 | ``` 39 | 40 | #### Flatpak 41 | ```bash 42 | $ flatpak run --command=sh com.spotify.Client -c 'eval "$(sed s#LD_PRELOAD=#LD_PRELOAD=$HOME/.spotify-adblock/spotify-adblock.so:#g /app/bin/spotify)"' 43 | ``` 44 | 45 | ### Desktop file 46 | You can integrate it with your desktop environment by creating a `.desktop` file (e.g. `spotify-adblock.desktop`) in `~/.local/share/applications`. This lets you easily run it from an application launcher without opening a terminal. 47 | 48 | Examples: 49 | 50 |
51 | Debian Package 52 |

53 | 54 | ``` 55 | [Desktop Entry] 56 | Type=Application 57 | Name=Spotify (adblock) 58 | GenericName=Music Player 59 | Icon=spotify-client 60 | TryExec=spotify 61 | Exec=env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U 62 | Terminal=false 63 | MimeType=x-scheme-handler/spotify; 64 | Categories=Audio;Music;Player;AudioVideo; 65 | StartupWMClass=spotify 66 | ``` 67 |

68 |
69 | 70 |
71 | Flatpak 72 |

73 | 74 | ``` 75 | [Desktop Entry] 76 | Type=Application 77 | Name=Spotify (adblock) 78 | GenericName=Music Player 79 | Icon=com.spotify.Client 80 | Exec=flatpak run --file-forwarding --command=sh com.spotify.Client -c 'eval "$(sed s#LD_PRELOAD=#LD_PRELOAD=$HOME/.spotify-adblock/spotify-adblock.so:#g /app/bin/spotify)"' @@u %U @@ 81 | Terminal=false 82 | MimeType=x-scheme-handler/spotify; 83 | Categories=Audio;Music;Player;AudioVideo; 84 | StartupWMClass=spotify 85 | ``` 86 |

87 |
88 | 89 | ## Uninstall 90 | ```bash 91 | $ sudo make uninstall 92 | ``` 93 | 94 | #### Flatpak 95 | ```bash 96 | $ rm -r ~/.spotify-adblock ~/.config/spotify-adblock 97 | $ flatpak override --user --reset com.spotify.Client 98 | ``` 99 | 100 | ## Configuration 101 | The allowlist and denylist can be configured in a config file located at (in descending order of precedence): 102 | * `config.toml` in the working directory 103 | * `$XDG_CONFIG_HOME/spotify-adblock/config.toml` 104 | * `~/.config/spotify-adblock/config.toml` 105 | * `/etc/spotify-adblock/config.toml` *(default)* 106 | -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | allowlist = [ 2 | 'localhost', # local proxies 3 | 'audio-sp-.*\.pscdn\.co', # audio 4 | 'audio-fa\.scdn\.co', # audio 5 | 'audio4-fa\.scdn\.co', # audio 6 | 'charts-images\.scdn\.co', # charts images 7 | 'daily-mix\.scdn\.co', # daily mix images 8 | 'dailymix-images\.scdn\.co', # daily mix images 9 | 'heads-fa\.scdn\.co', # audio (heads) 10 | 'i\.scdn\.co', # cover art 11 | 'lineup-images\.scdn\.co', # playlists lineup images 12 | 'merch-img\.scdn\.co', # merch images 13 | 'misc\.scdn\.co', # miscellaneous images 14 | 'mosaic\.scdn\.co', # playlist mosaic images 15 | 'newjams-images\.scdn\.co', # release radar images 16 | 'o\.scdn\.co', # cover art 17 | 'pl\.scdn\.co', # playlist images 18 | 'profile-images\.scdn\.co', # artist profile images 19 | 'seeded-session-images\.scdn\.co', # radio images 20 | 't\.scdn\.co', # background images 21 | 'thisis-images\.scdn\.co', # 'this is' playlists images 22 | 'video-fa\.scdn\.co', # videos 23 | '.*\.acast\.com', # podcasts 24 | 'content\.production\.cdn\.art19\.com', # podcasts 25 | 'rss\.art19\.com', # podcasts 26 | '.*\.buzzsprout\.com', # podcasts 27 | 'chtbl\.com', # podcasts 28 | 'platform-lookaside\.fbsbx\.com', # Facebook profile images 29 | 'genius\.com', # lyrics (genius-spicetify) 30 | '.*\.googlevideo\.com', # YouTube videos (Spicetify Reddit app) 31 | '.*\.gvt1\.com', # Widevine download 32 | 'content\.libsyn\.com', # podcasts 33 | 'hwcdn\.libsyn\.com', # podcasts 34 | 'traffic\.libsyn\.com', # podcasts 35 | 'api.*-desktop\.musixmatch\.com', # lyrics (genius-spicetify) 36 | '.*\.podbean\.com', # podcasts 37 | 'cdn\.podigee\.com', # podcasts 38 | 'dts\.podtrac\.com', # podcasts 39 | 'www\.podtrac\.com', # podcasts 40 | 'www\.reddit\.com', # Reddit (Spicetify Reddit app) 41 | 'audio\.simplecast\.com', # podcasts 42 | 'media\.simplecast\.com', # podcasts 43 | 'ap\.spotify\.com', # audio (access point) 44 | '.*\.ap\.spotify\.com', # access points 45 | 'ap-.*\.spotify\.com', # access points 46 | 'api\.spotify\.com', # client APIs 47 | 'api-partner\.spotify\.com', # album/artist pages 48 | 'xpui\.app\.spotify\.com', # user interface 49 | 'apresolve\.spotify\.com', # access point resolving 50 | 'clienttoken\.spotify\.com', # login 51 | '.*dealer.*\.spotify\.com', # websocket connections 52 | 'image-upload.*\.spotify\.com', # image uploading 53 | 'login.*\.spotify\.com', # login 54 | '.*-spclient\.spotify\.com', # client APIs 55 | 'spclient\.wg\.spotify\.com', # client APIs, ads/tracking (blocked in blacklist) 56 | 'audio-fa\.spotifycdn\.com', # audio 57 | 'mixed-media-images\.spotifycdn\.com', # mix images 58 | 'seed-mix-image\.spotifycdn\.com', # mix images 59 | 'api\.spreaker\.com', # podcasts 60 | 'download\.ted\.com', # podcasts 61 | 'www\.youtube\.com', # YouTube (Spicetify Reddit app) 62 | 'i\.ytimg\.com', # YouTube images (Spicetify Reddit app) 63 | 'chrt\.fm', # podcasts 64 | 'dcs.*\.megaphone\.fm', # podcasts 65 | 'traffic\.megaphone\.fm', # podcasts 66 | 'pdst\.fm', # podcasts 67 | 'audio-ak-spotify-com\.akamaized\.net', # audio 68 | 'audio-akp-spotify-com\.akamaized\.net', # audio 69 | 'audio4-ak-spotify-com\.akamaized\.net', # audio 70 | 'heads4-ak-spotify-com\.akamaized\.net', # audio (heads) 71 | '.*\.cloudfront\.net', # podcasts 72 | 'audio4-ak\.spotify\.com\.edgesuite\.net', # audio 73 | 'scontent.*\.fbcdn\.net', # Facebook profile images 74 | 'audio-sp-.*\.spotifycdn\.net', # audio 75 | 'dovetail\.prxu\.org', # podcasts 76 | 'dovetail-cdn\.prxu\.org', # podcasts 77 | ] 78 | 79 | denylist = [ 80 | 'https://spclient\.wg\.spotify\.com/ads/.*', # ads 81 | 'https://spclient\.wg\.spotify\.com/ad-logic/.*', # ads 82 | 'https://spclient\.wg\.spotify\.com/gabo-receiver-service/.*', # tracking 83 | ] 84 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 120 2 | -------------------------------------------------------------------------------- /src/cef.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Marshall A. Greenblatt. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the name Chromium Embedded 14 | // Framework nor the names of its contributors may be used to endorse 15 | // or promote products derived from this software without specific prior 16 | // written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #![allow(dead_code, non_camel_case_types, non_snake_case, non_upper_case_globals)] 31 | 32 | // bindgen --no-doc-comments --no-derive-copy --no-derive-debug --no-layout-tests --whitelist-function cef_urlrequest_create --whitelist-function cef_string_userfree_utf16_free -o src/cef.rs include/capi/cef_urlrequest_capi.h -- -I. 33 | 34 | /* automatically generated by rust-bindgen 0.57.0 */ 35 | pub type size_t = ::std::os::raw::c_ulong; 36 | pub type int64 = ::std::os::raw::c_long; 37 | pub type uint64 = ::std::os::raw::c_ulong; 38 | pub type uint32 = ::std::os::raw::c_uint; 39 | pub type char16 = ::std::os::raw::c_ushort; 40 | #[repr(C)] 41 | pub struct _cef_string_utf16_t { 42 | pub str_: *mut char16, 43 | pub length: size_t, 44 | pub dtor: ::std::option::Option, 45 | } 46 | pub type cef_string_utf16_t = _cef_string_utf16_t; 47 | pub type cef_string_userfree_utf16_t = *mut cef_string_utf16_t; 48 | extern "C" { 49 | pub fn cef_string_userfree_utf16_free(str_: cef_string_userfree_utf16_t); 50 | } 51 | pub type cef_string_userfree_t = cef_string_userfree_utf16_t; 52 | pub type cef_string_t = cef_string_utf16_t; 53 | pub type cef_string_list_t = *mut ::std::os::raw::c_void; 54 | pub type cef_string_map_t = *mut ::std::os::raw::c_void; 55 | pub type cef_string_multimap_t = *mut ::std::os::raw::c_void; 56 | #[repr(C)] 57 | pub struct _cef_time_t { 58 | pub year: ::std::os::raw::c_int, 59 | pub month: ::std::os::raw::c_int, 60 | pub day_of_week: ::std::os::raw::c_int, 61 | pub day_of_month: ::std::os::raw::c_int, 62 | pub hour: ::std::os::raw::c_int, 63 | pub minute: ::std::os::raw::c_int, 64 | pub second: ::std::os::raw::c_int, 65 | pub millisecond: ::std::os::raw::c_int, 66 | } 67 | pub type cef_time_t = _cef_time_t; 68 | #[repr(C)] 69 | pub struct _cef_window_info_t { 70 | pub window_name: cef_string_t, 71 | pub x: ::std::os::raw::c_uint, 72 | pub y: ::std::os::raw::c_uint, 73 | pub width: ::std::os::raw::c_uint, 74 | pub height: ::std::os::raw::c_uint, 75 | pub parent_window: ::std::os::raw::c_ulong, 76 | pub windowless_rendering_enabled: ::std::os::raw::c_int, 77 | pub shared_texture_enabled: ::std::os::raw::c_int, 78 | pub external_begin_frame_enabled: ::std::os::raw::c_int, 79 | pub window: ::std::os::raw::c_ulong, 80 | } 81 | pub type cef_color_t = uint32; 82 | pub const cef_state_t_STATE_DEFAULT: cef_state_t = 0; 83 | pub const cef_state_t_STATE_ENABLED: cef_state_t = 1; 84 | pub const cef_state_t_STATE_DISABLED: cef_state_t = 2; 85 | pub type cef_state_t = ::std::os::raw::c_uint; 86 | #[repr(C)] 87 | pub struct _cef_browser_settings_t { 88 | pub size: size_t, 89 | pub windowless_frame_rate: ::std::os::raw::c_int, 90 | pub standard_font_family: cef_string_t, 91 | pub fixed_font_family: cef_string_t, 92 | pub serif_font_family: cef_string_t, 93 | pub sans_serif_font_family: cef_string_t, 94 | pub cursive_font_family: cef_string_t, 95 | pub fantasy_font_family: cef_string_t, 96 | pub default_font_size: ::std::os::raw::c_int, 97 | pub default_fixed_font_size: ::std::os::raw::c_int, 98 | pub minimum_font_size: ::std::os::raw::c_int, 99 | pub minimum_logical_font_size: ::std::os::raw::c_int, 100 | pub default_encoding: cef_string_t, 101 | pub remote_fonts: cef_state_t, 102 | pub javascript: cef_state_t, 103 | pub javascript_close_windows: cef_state_t, 104 | pub javascript_access_clipboard: cef_state_t, 105 | pub javascript_dom_paste: cef_state_t, 106 | pub plugins: cef_state_t, 107 | pub universal_access_from_file_urls: cef_state_t, 108 | pub file_access_from_file_urls: cef_state_t, 109 | pub web_security: cef_state_t, 110 | pub image_loading: cef_state_t, 111 | pub image_shrink_standalone_to_fit: cef_state_t, 112 | pub text_area_resize: cef_state_t, 113 | pub tab_to_links: cef_state_t, 114 | pub local_storage: cef_state_t, 115 | pub databases: cef_state_t, 116 | pub application_cache: cef_state_t, 117 | pub webgl: cef_state_t, 118 | pub background_color: cef_color_t, 119 | pub accept_language_list: cef_string_t, 120 | } 121 | #[repr(C)] 122 | pub struct _cef_cookie_t { 123 | pub name: cef_string_t, 124 | pub value: cef_string_t, 125 | pub domain: cef_string_t, 126 | pub path: cef_string_t, 127 | pub secure: ::std::os::raw::c_int, 128 | pub httponly: ::std::os::raw::c_int, 129 | pub creation: cef_time_t, 130 | pub last_access: cef_time_t, 131 | pub has_expires: ::std::os::raw::c_int, 132 | pub expires: cef_time_t, 133 | } 134 | pub const cef_errorcode_t_ERR_NONE: cef_errorcode_t = 0; 135 | pub const cef_errorcode_t_ERR_IO_PENDING: cef_errorcode_t = -1; 136 | pub const cef_errorcode_t_ERR_FAILED: cef_errorcode_t = -2; 137 | pub const cef_errorcode_t_ERR_ABORTED: cef_errorcode_t = -3; 138 | pub const cef_errorcode_t_ERR_INVALID_ARGUMENT: cef_errorcode_t = -4; 139 | pub const cef_errorcode_t_ERR_INVALID_HANDLE: cef_errorcode_t = -5; 140 | pub const cef_errorcode_t_ERR_FILE_NOT_FOUND: cef_errorcode_t = -6; 141 | pub const cef_errorcode_t_ERR_TIMED_OUT: cef_errorcode_t = -7; 142 | pub const cef_errorcode_t_ERR_FILE_TOO_BIG: cef_errorcode_t = -8; 143 | pub const cef_errorcode_t_ERR_UNEXPECTED: cef_errorcode_t = -9; 144 | pub const cef_errorcode_t_ERR_ACCESS_DENIED: cef_errorcode_t = -10; 145 | pub const cef_errorcode_t_ERR_NOT_IMPLEMENTED: cef_errorcode_t = -11; 146 | pub const cef_errorcode_t_ERR_INSUFFICIENT_RESOURCES: cef_errorcode_t = -12; 147 | pub const cef_errorcode_t_ERR_OUT_OF_MEMORY: cef_errorcode_t = -13; 148 | pub const cef_errorcode_t_ERR_UPLOAD_FILE_CHANGED: cef_errorcode_t = -14; 149 | pub const cef_errorcode_t_ERR_SOCKET_NOT_CONNECTED: cef_errorcode_t = -15; 150 | pub const cef_errorcode_t_ERR_FILE_EXISTS: cef_errorcode_t = -16; 151 | pub const cef_errorcode_t_ERR_FILE_PATH_TOO_LONG: cef_errorcode_t = -17; 152 | pub const cef_errorcode_t_ERR_FILE_NO_SPACE: cef_errorcode_t = -18; 153 | pub const cef_errorcode_t_ERR_FILE_VIRUS_INFECTED: cef_errorcode_t = -19; 154 | pub const cef_errorcode_t_ERR_BLOCKED_BY_CLIENT: cef_errorcode_t = -20; 155 | pub const cef_errorcode_t_ERR_NETWORK_CHANGED: cef_errorcode_t = -21; 156 | pub const cef_errorcode_t_ERR_BLOCKED_BY_ADMINISTRATOR: cef_errorcode_t = -22; 157 | pub const cef_errorcode_t_ERR_SOCKET_IS_CONNECTED: cef_errorcode_t = -23; 158 | pub const cef_errorcode_t_ERR_BLOCKED_ENROLLMENT_CHECK_PENDING: cef_errorcode_t = -24; 159 | pub const cef_errorcode_t_ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED: cef_errorcode_t = -25; 160 | pub const cef_errorcode_t_ERR_CONTEXT_SHUT_DOWN: cef_errorcode_t = -26; 161 | pub const cef_errorcode_t_ERR_BLOCKED_BY_RESPONSE: cef_errorcode_t = -27; 162 | pub const cef_errorcode_t_ERR_CLEARTEXT_NOT_PERMITTED: cef_errorcode_t = -29; 163 | pub const cef_errorcode_t_ERR_CONNECTION_CLOSED: cef_errorcode_t = -100; 164 | pub const cef_errorcode_t_ERR_CONNECTION_RESET: cef_errorcode_t = -101; 165 | pub const cef_errorcode_t_ERR_CONNECTION_REFUSED: cef_errorcode_t = -102; 166 | pub const cef_errorcode_t_ERR_CONNECTION_ABORTED: cef_errorcode_t = -103; 167 | pub const cef_errorcode_t_ERR_CONNECTION_FAILED: cef_errorcode_t = -104; 168 | pub const cef_errorcode_t_ERR_NAME_NOT_RESOLVED: cef_errorcode_t = -105; 169 | pub const cef_errorcode_t_ERR_INTERNET_DISCONNECTED: cef_errorcode_t = -106; 170 | pub const cef_errorcode_t_ERR_SSL_PROTOCOL_ERROR: cef_errorcode_t = -107; 171 | pub const cef_errorcode_t_ERR_ADDRESS_INVALID: cef_errorcode_t = -108; 172 | pub const cef_errorcode_t_ERR_ADDRESS_UNREACHABLE: cef_errorcode_t = -109; 173 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_CERT_NEEDED: cef_errorcode_t = -110; 174 | pub const cef_errorcode_t_ERR_TUNNEL_CONNECTION_FAILED: cef_errorcode_t = -111; 175 | pub const cef_errorcode_t_ERR_NO_SSL_VERSIONS_ENABLED: cef_errorcode_t = -112; 176 | pub const cef_errorcode_t_ERR_SSL_VERSION_OR_CIPHER_MISMATCH: cef_errorcode_t = -113; 177 | pub const cef_errorcode_t_ERR_SSL_RENEGOTIATION_REQUESTED: cef_errorcode_t = -114; 178 | pub const cef_errorcode_t_ERR_PROXY_AUTH_UNSUPPORTED: cef_errorcode_t = -115; 179 | pub const cef_errorcode_t_ERR_CERT_ERROR_IN_SSL_RENEGOTIATION: cef_errorcode_t = -116; 180 | pub const cef_errorcode_t_ERR_BAD_SSL_CLIENT_AUTH_CERT: cef_errorcode_t = -117; 181 | pub const cef_errorcode_t_ERR_CONNECTION_TIMED_OUT: cef_errorcode_t = -118; 182 | pub const cef_errorcode_t_ERR_HOST_RESOLVER_QUEUE_TOO_LARGE: cef_errorcode_t = -119; 183 | pub const cef_errorcode_t_ERR_SOCKS_CONNECTION_FAILED: cef_errorcode_t = -120; 184 | pub const cef_errorcode_t_ERR_SOCKS_CONNECTION_HOST_UNREACHABLE: cef_errorcode_t = -121; 185 | pub const cef_errorcode_t_ERR_ALPN_NEGOTIATION_FAILED: cef_errorcode_t = -122; 186 | pub const cef_errorcode_t_ERR_SSL_NO_RENEGOTIATION: cef_errorcode_t = -123; 187 | pub const cef_errorcode_t_ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES: cef_errorcode_t = -124; 188 | pub const cef_errorcode_t_ERR_SSL_DECOMPRESSION_FAILURE_ALERT: cef_errorcode_t = -125; 189 | pub const cef_errorcode_t_ERR_SSL_BAD_RECORD_MAC_ALERT: cef_errorcode_t = -126; 190 | pub const cef_errorcode_t_ERR_PROXY_AUTH_REQUESTED: cef_errorcode_t = -127; 191 | pub const cef_errorcode_t_ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY: cef_errorcode_t = -129; 192 | pub const cef_errorcode_t_ERR_PROXY_CONNECTION_FAILED: cef_errorcode_t = -130; 193 | pub const cef_errorcode_t_ERR_MANDATORY_PROXY_CONFIGURATION_FAILED: cef_errorcode_t = -131; 194 | pub const cef_errorcode_t_ERR_PRECONNECT_MAX_SOCKET_LIMIT: cef_errorcode_t = -133; 195 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED: cef_errorcode_t = -134; 196 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY: cef_errorcode_t = -135; 197 | pub const cef_errorcode_t_ERR_PROXY_CERTIFICATE_INVALID: cef_errorcode_t = -136; 198 | pub const cef_errorcode_t_ERR_NAME_RESOLUTION_FAILED: cef_errorcode_t = -137; 199 | pub const cef_errorcode_t_ERR_NETWORK_ACCESS_DENIED: cef_errorcode_t = -138; 200 | pub const cef_errorcode_t_ERR_TEMPORARILY_THROTTLED: cef_errorcode_t = -139; 201 | pub const cef_errorcode_t_ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT: cef_errorcode_t = -140; 202 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED: cef_errorcode_t = -141; 203 | pub const cef_errorcode_t_ERR_MSG_TOO_BIG: cef_errorcode_t = -142; 204 | pub const cef_errorcode_t_ERR_WS_PROTOCOL_ERROR: cef_errorcode_t = -145; 205 | pub const cef_errorcode_t_ERR_ADDRESS_IN_USE: cef_errorcode_t = -147; 206 | pub const cef_errorcode_t_ERR_SSL_HANDSHAKE_NOT_COMPLETED: cef_errorcode_t = -148; 207 | pub const cef_errorcode_t_ERR_SSL_BAD_PEER_PUBLIC_KEY: cef_errorcode_t = -149; 208 | pub const cef_errorcode_t_ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN: cef_errorcode_t = -150; 209 | pub const cef_errorcode_t_ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED: cef_errorcode_t = -151; 210 | pub const cef_errorcode_t_ERR_SSL_DECRYPT_ERROR_ALERT: cef_errorcode_t = -153; 211 | pub const cef_errorcode_t_ERR_WS_THROTTLE_QUEUE_TOO_LARGE: cef_errorcode_t = -154; 212 | pub const cef_errorcode_t_ERR_SSL_SERVER_CERT_CHANGED: cef_errorcode_t = -156; 213 | pub const cef_errorcode_t_ERR_SSL_UNRECOGNIZED_NAME_ALERT: cef_errorcode_t = -159; 214 | pub const cef_errorcode_t_ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR: cef_errorcode_t = -160; 215 | pub const cef_errorcode_t_ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR: cef_errorcode_t = -161; 216 | pub const cef_errorcode_t_ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE: cef_errorcode_t = -162; 217 | pub const cef_errorcode_t_ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE: cef_errorcode_t = -163; 218 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT: cef_errorcode_t = -164; 219 | pub const cef_errorcode_t_ERR_ICANN_NAME_COLLISION: cef_errorcode_t = -166; 220 | pub const cef_errorcode_t_ERR_SSL_SERVER_CERT_BAD_FORMAT: cef_errorcode_t = -167; 221 | pub const cef_errorcode_t_ERR_CT_STH_PARSING_FAILED: cef_errorcode_t = -168; 222 | pub const cef_errorcode_t_ERR_CT_STH_INCOMPLETE: cef_errorcode_t = -169; 223 | pub const cef_errorcode_t_ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH: cef_errorcode_t = -170; 224 | pub const cef_errorcode_t_ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED: cef_errorcode_t = -171; 225 | pub const cef_errorcode_t_ERR_SSL_OBSOLETE_CIPHER: cef_errorcode_t = -172; 226 | pub const cef_errorcode_t_ERR_WS_UPGRADE: cef_errorcode_t = -173; 227 | pub const cef_errorcode_t_ERR_READ_IF_READY_NOT_IMPLEMENTED: cef_errorcode_t = -174; 228 | pub const cef_errorcode_t_ERR_NO_BUFFER_SPACE: cef_errorcode_t = -176; 229 | pub const cef_errorcode_t_ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS: cef_errorcode_t = -177; 230 | pub const cef_errorcode_t_ERR_EARLY_DATA_REJECTED: cef_errorcode_t = -178; 231 | pub const cef_errorcode_t_ERR_WRONG_VERSION_ON_EARLY_DATA: cef_errorcode_t = -179; 232 | pub const cef_errorcode_t_ERR_TLS13_DOWNGRADE_DETECTED: cef_errorcode_t = -180; 233 | pub const cef_errorcode_t_ERR_SSL_KEY_USAGE_INCOMPATIBLE: cef_errorcode_t = -181; 234 | pub const cef_errorcode_t_ERR_CERT_COMMON_NAME_INVALID: cef_errorcode_t = -200; 235 | pub const cef_errorcode_t_ERR_CERT_DATE_INVALID: cef_errorcode_t = -201; 236 | pub const cef_errorcode_t_ERR_CERT_AUTHORITY_INVALID: cef_errorcode_t = -202; 237 | pub const cef_errorcode_t_ERR_CERT_CONTAINS_ERRORS: cef_errorcode_t = -203; 238 | pub const cef_errorcode_t_ERR_CERT_NO_REVOCATION_MECHANISM: cef_errorcode_t = -204; 239 | pub const cef_errorcode_t_ERR_CERT_UNABLE_TO_CHECK_REVOCATION: cef_errorcode_t = -205; 240 | pub const cef_errorcode_t_ERR_CERT_REVOKED: cef_errorcode_t = -206; 241 | pub const cef_errorcode_t_ERR_CERT_INVALID: cef_errorcode_t = -207; 242 | pub const cef_errorcode_t_ERR_CERT_WEAK_SIGNATURE_ALGORITHM: cef_errorcode_t = -208; 243 | pub const cef_errorcode_t_ERR_CERT_NON_UNIQUE_NAME: cef_errorcode_t = -210; 244 | pub const cef_errorcode_t_ERR_CERT_WEAK_KEY: cef_errorcode_t = -211; 245 | pub const cef_errorcode_t_ERR_CERT_NAME_CONSTRAINT_VIOLATION: cef_errorcode_t = -212; 246 | pub const cef_errorcode_t_ERR_CERT_VALIDITY_TOO_LONG: cef_errorcode_t = -213; 247 | pub const cef_errorcode_t_ERR_CERTIFICATE_TRANSPARENCY_REQUIRED: cef_errorcode_t = -214; 248 | pub const cef_errorcode_t_ERR_CERT_SYMANTEC_LEGACY: cef_errorcode_t = -215; 249 | pub const cef_errorcode_t_ERR_CERT_KNOWN_INTERCEPTION_BLOCKED: cef_errorcode_t = -217; 250 | pub const cef_errorcode_t_ERR_CERT_END: cef_errorcode_t = -218; 251 | pub const cef_errorcode_t_ERR_INVALID_URL: cef_errorcode_t = -300; 252 | pub const cef_errorcode_t_ERR_DISALLOWED_URL_SCHEME: cef_errorcode_t = -301; 253 | pub const cef_errorcode_t_ERR_UNKNOWN_URL_SCHEME: cef_errorcode_t = -302; 254 | pub const cef_errorcode_t_ERR_INVALID_REDIRECT: cef_errorcode_t = -303; 255 | pub const cef_errorcode_t_ERR_TOO_MANY_REDIRECTS: cef_errorcode_t = -310; 256 | pub const cef_errorcode_t_ERR_UNSAFE_REDIRECT: cef_errorcode_t = -311; 257 | pub const cef_errorcode_t_ERR_UNSAFE_PORT: cef_errorcode_t = -312; 258 | pub const cef_errorcode_t_ERR_INVALID_RESPONSE: cef_errorcode_t = -320; 259 | pub const cef_errorcode_t_ERR_INVALID_CHUNKED_ENCODING: cef_errorcode_t = -321; 260 | pub const cef_errorcode_t_ERR_METHOD_NOT_SUPPORTED: cef_errorcode_t = -322; 261 | pub const cef_errorcode_t_ERR_UNEXPECTED_PROXY_AUTH: cef_errorcode_t = -323; 262 | pub const cef_errorcode_t_ERR_EMPTY_RESPONSE: cef_errorcode_t = -324; 263 | pub const cef_errorcode_t_ERR_RESPONSE_HEADERS_TOO_BIG: cef_errorcode_t = -325; 264 | pub const cef_errorcode_t_ERR_PAC_SCRIPT_FAILED: cef_errorcode_t = -327; 265 | pub const cef_errorcode_t_ERR_REQUEST_RANGE_NOT_SATISFIABLE: cef_errorcode_t = -328; 266 | pub const cef_errorcode_t_ERR_MALFORMED_IDENTITY: cef_errorcode_t = -329; 267 | pub const cef_errorcode_t_ERR_CONTENT_DECODING_FAILED: cef_errorcode_t = -330; 268 | pub const cef_errorcode_t_ERR_NETWORK_IO_SUSPENDED: cef_errorcode_t = -331; 269 | pub const cef_errorcode_t_ERR_SYN_REPLY_NOT_RECEIVED: cef_errorcode_t = -332; 270 | pub const cef_errorcode_t_ERR_ENCODING_CONVERSION_FAILED: cef_errorcode_t = -333; 271 | pub const cef_errorcode_t_ERR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT: cef_errorcode_t = -334; 272 | pub const cef_errorcode_t_ERR_NO_SUPPORTED_PROXIES: cef_errorcode_t = -336; 273 | pub const cef_errorcode_t_ERR_HTTP2_PROTOCOL_ERROR: cef_errorcode_t = -337; 274 | pub const cef_errorcode_t_ERR_INVALID_AUTH_CREDENTIALS: cef_errorcode_t = -338; 275 | pub const cef_errorcode_t_ERR_UNSUPPORTED_AUTH_SCHEME: cef_errorcode_t = -339; 276 | pub const cef_errorcode_t_ERR_ENCODING_DETECTION_FAILED: cef_errorcode_t = -340; 277 | pub const cef_errorcode_t_ERR_MISSING_AUTH_CREDENTIALS: cef_errorcode_t = -341; 278 | pub const cef_errorcode_t_ERR_UNEXPECTED_SECURITY_LIBRARY_STATUS: cef_errorcode_t = -342; 279 | pub const cef_errorcode_t_ERR_MISCONFIGURED_AUTH_ENVIRONMENT: cef_errorcode_t = -343; 280 | pub const cef_errorcode_t_ERR_UNDOCUMENTED_SECURITY_LIBRARY_STATUS: cef_errorcode_t = -344; 281 | pub const cef_errorcode_t_ERR_RESPONSE_BODY_TOO_BIG_TO_DRAIN: cef_errorcode_t = -345; 282 | pub const cef_errorcode_t_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH: cef_errorcode_t = -346; 283 | pub const cef_errorcode_t_ERR_INCOMPLETE_HTTP2_HEADERS: cef_errorcode_t = -347; 284 | pub const cef_errorcode_t_ERR_PAC_NOT_IN_DHCP: cef_errorcode_t = -348; 285 | pub const cef_errorcode_t_ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION: cef_errorcode_t = -349; 286 | pub const cef_errorcode_t_ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION: cef_errorcode_t = -350; 287 | pub const cef_errorcode_t_ERR_HTTP2_SERVER_REFUSED_STREAM: cef_errorcode_t = -351; 288 | pub const cef_errorcode_t_ERR_HTTP2_PING_FAILED: cef_errorcode_t = -352; 289 | pub const cef_errorcode_t_ERR_CONTENT_LENGTH_MISMATCH: cef_errorcode_t = -354; 290 | pub const cef_errorcode_t_ERR_INCOMPLETE_CHUNKED_ENCODING: cef_errorcode_t = -355; 291 | pub const cef_errorcode_t_ERR_QUIC_PROTOCOL_ERROR: cef_errorcode_t = -356; 292 | pub const cef_errorcode_t_ERR_RESPONSE_HEADERS_TRUNCATED: cef_errorcode_t = -357; 293 | pub const cef_errorcode_t_ERR_QUIC_HANDSHAKE_FAILED: cef_errorcode_t = -358; 294 | pub const cef_errorcode_t_ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY: cef_errorcode_t = -360; 295 | pub const cef_errorcode_t_ERR_HTTP2_FLOW_CONTROL_ERROR: cef_errorcode_t = -361; 296 | pub const cef_errorcode_t_ERR_HTTP2_FRAME_SIZE_ERROR: cef_errorcode_t = -362; 297 | pub const cef_errorcode_t_ERR_HTTP2_COMPRESSION_ERROR: cef_errorcode_t = -363; 298 | pub const cef_errorcode_t_ERR_PROXY_AUTH_REQUESTED_WITH_NO_CONNECTION: cef_errorcode_t = -364; 299 | pub const cef_errorcode_t_ERR_HTTP_1_1_REQUIRED: cef_errorcode_t = -365; 300 | pub const cef_errorcode_t_ERR_PROXY_HTTP_1_1_REQUIRED: cef_errorcode_t = -366; 301 | pub const cef_errorcode_t_ERR_PAC_SCRIPT_TERMINATED: cef_errorcode_t = -367; 302 | pub const cef_errorcode_t_ERR_INVALID_HTTP_RESPONSE: cef_errorcode_t = -370; 303 | pub const cef_errorcode_t_ERR_CONTENT_DECODING_INIT_FAILED: cef_errorcode_t = -371; 304 | pub const cef_errorcode_t_ERR_HTTP2_RST_STREAM_NO_ERROR_RECEIVED: cef_errorcode_t = -372; 305 | pub const cef_errorcode_t_ERR_HTTP2_PUSHED_STREAM_NOT_AVAILABLE: cef_errorcode_t = -373; 306 | pub const cef_errorcode_t_ERR_HTTP2_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER: cef_errorcode_t = -374; 307 | pub const cef_errorcode_t_ERR_TOO_MANY_RETRIES: cef_errorcode_t = -375; 308 | pub const cef_errorcode_t_ERR_HTTP2_STREAM_CLOSED: cef_errorcode_t = -376; 309 | pub const cef_errorcode_t_ERR_HTTP2_CLIENT_REFUSED_STREAM: cef_errorcode_t = -377; 310 | pub const cef_errorcode_t_ERR_HTTP2_PUSHED_RESPONSE_DOES_NOT_MATCH: cef_errorcode_t = -378; 311 | pub const cef_errorcode_t_ERR_HTTP_RESPONSE_CODE_FAILURE: cef_errorcode_t = -379; 312 | pub const cef_errorcode_t_ERR_QUIC_CERT_ROOT_NOT_KNOWN: cef_errorcode_t = -380; 313 | pub const cef_errorcode_t_ERR_CACHE_MISS: cef_errorcode_t = -400; 314 | pub const cef_errorcode_t_ERR_CACHE_READ_FAILURE: cef_errorcode_t = -401; 315 | pub const cef_errorcode_t_ERR_CACHE_WRITE_FAILURE: cef_errorcode_t = -402; 316 | pub const cef_errorcode_t_ERR_CACHE_OPERATION_NOT_SUPPORTED: cef_errorcode_t = -403; 317 | pub const cef_errorcode_t_ERR_CACHE_OPEN_FAILURE: cef_errorcode_t = -404; 318 | pub const cef_errorcode_t_ERR_CACHE_CREATE_FAILURE: cef_errorcode_t = -405; 319 | pub const cef_errorcode_t_ERR_CACHE_RACE: cef_errorcode_t = -406; 320 | pub const cef_errorcode_t_ERR_CACHE_CHECKSUM_READ_FAILURE: cef_errorcode_t = -407; 321 | pub const cef_errorcode_t_ERR_CACHE_CHECKSUM_MISMATCH: cef_errorcode_t = -408; 322 | pub const cef_errorcode_t_ERR_CACHE_LOCK_TIMEOUT: cef_errorcode_t = -409; 323 | pub const cef_errorcode_t_ERR_CACHE_AUTH_FAILURE_AFTER_READ: cef_errorcode_t = -410; 324 | pub const cef_errorcode_t_ERR_CACHE_ENTRY_NOT_SUITABLE: cef_errorcode_t = -411; 325 | pub const cef_errorcode_t_ERR_CACHE_DOOM_FAILURE: cef_errorcode_t = -412; 326 | pub const cef_errorcode_t_ERR_CACHE_OPEN_OR_CREATE_FAILURE: cef_errorcode_t = -413; 327 | pub const cef_errorcode_t_ERR_INSECURE_RESPONSE: cef_errorcode_t = -501; 328 | pub const cef_errorcode_t_ERR_NO_PRIVATE_KEY_FOR_CERT: cef_errorcode_t = -502; 329 | pub const cef_errorcode_t_ERR_ADD_USER_CERT_FAILED: cef_errorcode_t = -503; 330 | pub const cef_errorcode_t_ERR_INVALID_SIGNED_EXCHANGE: cef_errorcode_t = -504; 331 | pub const cef_errorcode_t_ERR_INVALID_WEB_BUNDLE: cef_errorcode_t = -505; 332 | pub const cef_errorcode_t_ERR_FTP_FAILED: cef_errorcode_t = -601; 333 | pub const cef_errorcode_t_ERR_FTP_SERVICE_UNAVAILABLE: cef_errorcode_t = -602; 334 | pub const cef_errorcode_t_ERR_FTP_TRANSFER_ABORTED: cef_errorcode_t = -603; 335 | pub const cef_errorcode_t_ERR_FTP_FILE_BUSY: cef_errorcode_t = -604; 336 | pub const cef_errorcode_t_ERR_FTP_SYNTAX_ERROR: cef_errorcode_t = -605; 337 | pub const cef_errorcode_t_ERR_FTP_COMMAND_NOT_SUPPORTED: cef_errorcode_t = -606; 338 | pub const cef_errorcode_t_ERR_FTP_BAD_COMMAND_SEQUENCE: cef_errorcode_t = -607; 339 | pub const cef_errorcode_t_ERR_PKCS12_IMPORT_BAD_PASSWORD: cef_errorcode_t = -701; 340 | pub const cef_errorcode_t_ERR_PKCS12_IMPORT_FAILED: cef_errorcode_t = -702; 341 | pub const cef_errorcode_t_ERR_IMPORT_CA_CERT_NOT_CA: cef_errorcode_t = -703; 342 | pub const cef_errorcode_t_ERR_IMPORT_CERT_ALREADY_EXISTS: cef_errorcode_t = -704; 343 | pub const cef_errorcode_t_ERR_IMPORT_CA_CERT_FAILED: cef_errorcode_t = -705; 344 | pub const cef_errorcode_t_ERR_IMPORT_SERVER_CERT_FAILED: cef_errorcode_t = -706; 345 | pub const cef_errorcode_t_ERR_PKCS12_IMPORT_INVALID_MAC: cef_errorcode_t = -707; 346 | pub const cef_errorcode_t_ERR_PKCS12_IMPORT_INVALID_FILE: cef_errorcode_t = -708; 347 | pub const cef_errorcode_t_ERR_PKCS12_IMPORT_UNSUPPORTED: cef_errorcode_t = -709; 348 | pub const cef_errorcode_t_ERR_KEY_GENERATION_FAILED: cef_errorcode_t = -710; 349 | pub const cef_errorcode_t_ERR_PRIVATE_KEY_EXPORT_FAILED: cef_errorcode_t = -712; 350 | pub const cef_errorcode_t_ERR_SELF_SIGNED_CERT_GENERATION_FAILED: cef_errorcode_t = -713; 351 | pub const cef_errorcode_t_ERR_CERT_DATABASE_CHANGED: cef_errorcode_t = -714; 352 | pub const cef_errorcode_t_ERR_DNS_MALFORMED_RESPONSE: cef_errorcode_t = -800; 353 | pub const cef_errorcode_t_ERR_DNS_SERVER_REQUIRES_TCP: cef_errorcode_t = -801; 354 | pub const cef_errorcode_t_ERR_DNS_SERVER_FAILED: cef_errorcode_t = -802; 355 | pub const cef_errorcode_t_ERR_DNS_TIMED_OUT: cef_errorcode_t = -803; 356 | pub const cef_errorcode_t_ERR_DNS_CACHE_MISS: cef_errorcode_t = -804; 357 | pub const cef_errorcode_t_ERR_DNS_SEARCH_EMPTY: cef_errorcode_t = -805; 358 | pub const cef_errorcode_t_ERR_DNS_SORT_ERROR: cef_errorcode_t = -806; 359 | pub const cef_errorcode_t_ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED: cef_errorcode_t = -808; 360 | pub type cef_errorcode_t = ::std::os::raw::c_int; 361 | pub const cef_cert_status_t_CERT_STATUS_NONE: cef_cert_status_t = 0; 362 | pub const cef_cert_status_t_CERT_STATUS_COMMON_NAME_INVALID: cef_cert_status_t = 1; 363 | pub const cef_cert_status_t_CERT_STATUS_DATE_INVALID: cef_cert_status_t = 2; 364 | pub const cef_cert_status_t_CERT_STATUS_AUTHORITY_INVALID: cef_cert_status_t = 4; 365 | pub const cef_cert_status_t_CERT_STATUS_NO_REVOCATION_MECHANISM: cef_cert_status_t = 16; 366 | pub const cef_cert_status_t_CERT_STATUS_UNABLE_TO_CHECK_REVOCATION: cef_cert_status_t = 32; 367 | pub const cef_cert_status_t_CERT_STATUS_REVOKED: cef_cert_status_t = 64; 368 | pub const cef_cert_status_t_CERT_STATUS_INVALID: cef_cert_status_t = 128; 369 | pub const cef_cert_status_t_CERT_STATUS_WEAK_SIGNATURE_ALGORITHM: cef_cert_status_t = 256; 370 | pub const cef_cert_status_t_CERT_STATUS_NON_UNIQUE_NAME: cef_cert_status_t = 1024; 371 | pub const cef_cert_status_t_CERT_STATUS_WEAK_KEY: cef_cert_status_t = 2048; 372 | pub const cef_cert_status_t_CERT_STATUS_PINNED_KEY_MISSING: cef_cert_status_t = 8192; 373 | pub const cef_cert_status_t_CERT_STATUS_NAME_CONSTRAINT_VIOLATION: cef_cert_status_t = 16384; 374 | pub const cef_cert_status_t_CERT_STATUS_VALIDITY_TOO_LONG: cef_cert_status_t = 32768; 375 | pub const cef_cert_status_t_CERT_STATUS_IS_EV: cef_cert_status_t = 65536; 376 | pub const cef_cert_status_t_CERT_STATUS_REV_CHECKING_ENABLED: cef_cert_status_t = 131072; 377 | pub const cef_cert_status_t_CERT_STATUS_SHA1_SIGNATURE_PRESENT: cef_cert_status_t = 524288; 378 | pub const cef_cert_status_t_CERT_STATUS_CT_COMPLIANCE_FAILED: cef_cert_status_t = 1048576; 379 | pub type cef_cert_status_t = ::std::os::raw::c_uint; 380 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_NONE: cef_drag_operations_mask_t = 0; 381 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_COPY: cef_drag_operations_mask_t = 1; 382 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_LINK: cef_drag_operations_mask_t = 2; 383 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_GENERIC: cef_drag_operations_mask_t = 4; 384 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_PRIVATE: cef_drag_operations_mask_t = 8; 385 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_MOVE: cef_drag_operations_mask_t = 16; 386 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_DELETE: cef_drag_operations_mask_t = 32; 387 | pub const cef_drag_operations_mask_t_DRAG_OPERATION_EVERY: cef_drag_operations_mask_t = 4294967295; 388 | pub type cef_drag_operations_mask_t = ::std::os::raw::c_uint; 389 | pub const cef_postdataelement_type_t_PDE_TYPE_EMPTY: cef_postdataelement_type_t = 0; 390 | pub const cef_postdataelement_type_t_PDE_TYPE_BYTES: cef_postdataelement_type_t = 1; 391 | pub const cef_postdataelement_type_t_PDE_TYPE_FILE: cef_postdataelement_type_t = 2; 392 | pub type cef_postdataelement_type_t = ::std::os::raw::c_uint; 393 | pub const cef_resource_type_t_RT_MAIN_FRAME: cef_resource_type_t = 0; 394 | pub const cef_resource_type_t_RT_SUB_FRAME: cef_resource_type_t = 1; 395 | pub const cef_resource_type_t_RT_STYLESHEET: cef_resource_type_t = 2; 396 | pub const cef_resource_type_t_RT_SCRIPT: cef_resource_type_t = 3; 397 | pub const cef_resource_type_t_RT_IMAGE: cef_resource_type_t = 4; 398 | pub const cef_resource_type_t_RT_FONT_RESOURCE: cef_resource_type_t = 5; 399 | pub const cef_resource_type_t_RT_SUB_RESOURCE: cef_resource_type_t = 6; 400 | pub const cef_resource_type_t_RT_OBJECT: cef_resource_type_t = 7; 401 | pub const cef_resource_type_t_RT_MEDIA: cef_resource_type_t = 8; 402 | pub const cef_resource_type_t_RT_WORKER: cef_resource_type_t = 9; 403 | pub const cef_resource_type_t_RT_SHARED_WORKER: cef_resource_type_t = 10; 404 | pub const cef_resource_type_t_RT_PREFETCH: cef_resource_type_t = 11; 405 | pub const cef_resource_type_t_RT_FAVICON: cef_resource_type_t = 12; 406 | pub const cef_resource_type_t_RT_XHR: cef_resource_type_t = 13; 407 | pub const cef_resource_type_t_RT_PING: cef_resource_type_t = 14; 408 | pub const cef_resource_type_t_RT_SERVICE_WORKER: cef_resource_type_t = 15; 409 | pub const cef_resource_type_t_RT_CSP_REPORT: cef_resource_type_t = 16; 410 | pub const cef_resource_type_t_RT_PLUGIN_RESOURCE: cef_resource_type_t = 17; 411 | pub type cef_resource_type_t = ::std::os::raw::c_uint; 412 | pub const cef_transition_type_t_TT_LINK: cef_transition_type_t = 0; 413 | pub const cef_transition_type_t_TT_EXPLICIT: cef_transition_type_t = 1; 414 | pub const cef_transition_type_t_TT_AUTO_SUBFRAME: cef_transition_type_t = 3; 415 | pub const cef_transition_type_t_TT_MANUAL_SUBFRAME: cef_transition_type_t = 4; 416 | pub const cef_transition_type_t_TT_FORM_SUBMIT: cef_transition_type_t = 7; 417 | pub const cef_transition_type_t_TT_RELOAD: cef_transition_type_t = 8; 418 | pub const cef_transition_type_t_TT_SOURCE_MASK: cef_transition_type_t = 255; 419 | pub const cef_transition_type_t_TT_BLOCKED_FLAG: cef_transition_type_t = 8388608; 420 | pub const cef_transition_type_t_TT_FORWARD_BACK_FLAG: cef_transition_type_t = 16777216; 421 | pub const cef_transition_type_t_TT_DIRECT_LOAD_FLAG: cef_transition_type_t = 33554432; 422 | pub const cef_transition_type_t_TT_CHAIN_START_FLAG: cef_transition_type_t = 268435456; 423 | pub const cef_transition_type_t_TT_CHAIN_END_FLAG: cef_transition_type_t = 536870912; 424 | pub const cef_transition_type_t_TT_CLIENT_REDIRECT_FLAG: cef_transition_type_t = 1073741824; 425 | pub const cef_transition_type_t_TT_SERVER_REDIRECT_FLAG: cef_transition_type_t = 2147483648; 426 | pub const cef_transition_type_t_TT_IS_REDIRECT_MASK: cef_transition_type_t = 3221225472; 427 | pub const cef_transition_type_t_TT_QUALIFIER_MASK: cef_transition_type_t = 4294967040; 428 | pub type cef_transition_type_t = ::std::os::raw::c_uint; 429 | pub const cef_urlrequest_status_t_UR_UNKNOWN: cef_urlrequest_status_t = 0; 430 | pub const cef_urlrequest_status_t_UR_SUCCESS: cef_urlrequest_status_t = 1; 431 | pub const cef_urlrequest_status_t_UR_IO_PENDING: cef_urlrequest_status_t = 2; 432 | pub const cef_urlrequest_status_t_UR_CANCELED: cef_urlrequest_status_t = 3; 433 | pub const cef_urlrequest_status_t_UR_FAILED: cef_urlrequest_status_t = 4; 434 | pub type cef_urlrequest_status_t = ::std::os::raw::c_uint; 435 | #[repr(C)] 436 | pub struct _cef_point_t { 437 | pub x: ::std::os::raw::c_int, 438 | pub y: ::std::os::raw::c_int, 439 | } 440 | pub type cef_point_t = _cef_point_t; 441 | #[repr(C)] 442 | pub struct _cef_rect_t { 443 | pub x: ::std::os::raw::c_int, 444 | pub y: ::std::os::raw::c_int, 445 | pub width: ::std::os::raw::c_int, 446 | pub height: ::std::os::raw::c_int, 447 | } 448 | pub type cef_rect_t = _cef_rect_t; 449 | #[repr(C)] 450 | pub struct _cef_size_t { 451 | pub width: ::std::os::raw::c_int, 452 | pub height: ::std::os::raw::c_int, 453 | } 454 | pub type cef_size_t = _cef_size_t; 455 | #[repr(C)] 456 | pub struct _cef_range_t { 457 | pub from: ::std::os::raw::c_int, 458 | pub to: ::std::os::raw::c_int, 459 | } 460 | pub type cef_range_t = _cef_range_t; 461 | pub const cef_process_id_t_PID_BROWSER: cef_process_id_t = 0; 462 | pub const cef_process_id_t_PID_RENDERER: cef_process_id_t = 1; 463 | pub type cef_process_id_t = ::std::os::raw::c_uint; 464 | pub const cef_value_type_t_VTYPE_INVALID: cef_value_type_t = 0; 465 | pub const cef_value_type_t_VTYPE_NULL: cef_value_type_t = 1; 466 | pub const cef_value_type_t_VTYPE_BOOL: cef_value_type_t = 2; 467 | pub const cef_value_type_t_VTYPE_INT: cef_value_type_t = 3; 468 | pub const cef_value_type_t_VTYPE_DOUBLE: cef_value_type_t = 4; 469 | pub const cef_value_type_t_VTYPE_STRING: cef_value_type_t = 5; 470 | pub const cef_value_type_t_VTYPE_BINARY: cef_value_type_t = 6; 471 | pub const cef_value_type_t_VTYPE_DICTIONARY: cef_value_type_t = 7; 472 | pub const cef_value_type_t_VTYPE_LIST: cef_value_type_t = 8; 473 | pub type cef_value_type_t = ::std::os::raw::c_uint; 474 | pub const cef_mouse_button_type_t_MBT_LEFT: cef_mouse_button_type_t = 0; 475 | pub const cef_mouse_button_type_t_MBT_MIDDLE: cef_mouse_button_type_t = 1; 476 | pub const cef_mouse_button_type_t_MBT_RIGHT: cef_mouse_button_type_t = 2; 477 | pub type cef_mouse_button_type_t = ::std::os::raw::c_uint; 478 | #[repr(C)] 479 | pub struct _cef_mouse_event_t { 480 | pub x: ::std::os::raw::c_int, 481 | pub y: ::std::os::raw::c_int, 482 | pub modifiers: uint32, 483 | } 484 | pub const cef_touch_event_type_t_CEF_TET_RELEASED: cef_touch_event_type_t = 0; 485 | pub const cef_touch_event_type_t_CEF_TET_PRESSED: cef_touch_event_type_t = 1; 486 | pub const cef_touch_event_type_t_CEF_TET_MOVED: cef_touch_event_type_t = 2; 487 | pub const cef_touch_event_type_t_CEF_TET_CANCELLED: cef_touch_event_type_t = 3; 488 | pub type cef_touch_event_type_t = ::std::os::raw::c_uint; 489 | pub const cef_pointer_type_t_CEF_POINTER_TYPE_TOUCH: cef_pointer_type_t = 0; 490 | pub const cef_pointer_type_t_CEF_POINTER_TYPE_MOUSE: cef_pointer_type_t = 1; 491 | pub const cef_pointer_type_t_CEF_POINTER_TYPE_PEN: cef_pointer_type_t = 2; 492 | pub const cef_pointer_type_t_CEF_POINTER_TYPE_ERASER: cef_pointer_type_t = 3; 493 | pub const cef_pointer_type_t_CEF_POINTER_TYPE_UNKNOWN: cef_pointer_type_t = 4; 494 | pub type cef_pointer_type_t = ::std::os::raw::c_uint; 495 | #[repr(C)] 496 | pub struct _cef_touch_event_t { 497 | pub id: ::std::os::raw::c_int, 498 | pub x: f32, 499 | pub y: f32, 500 | pub radius_x: f32, 501 | pub radius_y: f32, 502 | pub rotation_angle: f32, 503 | pub pressure: f32, 504 | pub type_: cef_touch_event_type_t, 505 | pub modifiers: uint32, 506 | pub pointer_type: cef_pointer_type_t, 507 | } 508 | pub const cef_paint_element_type_t_PET_VIEW: cef_paint_element_type_t = 0; 509 | pub const cef_paint_element_type_t_PET_POPUP: cef_paint_element_type_t = 1; 510 | pub type cef_paint_element_type_t = ::std::os::raw::c_uint; 511 | pub const cef_key_event_type_t_KEYEVENT_RAWKEYDOWN: cef_key_event_type_t = 0; 512 | pub const cef_key_event_type_t_KEYEVENT_KEYDOWN: cef_key_event_type_t = 1; 513 | pub const cef_key_event_type_t_KEYEVENT_KEYUP: cef_key_event_type_t = 2; 514 | pub const cef_key_event_type_t_KEYEVENT_CHAR: cef_key_event_type_t = 3; 515 | pub type cef_key_event_type_t = ::std::os::raw::c_uint; 516 | #[repr(C)] 517 | pub struct _cef_key_event_t { 518 | pub type_: cef_key_event_type_t, 519 | pub modifiers: uint32, 520 | pub windows_key_code: ::std::os::raw::c_int, 521 | pub native_key_code: ::std::os::raw::c_int, 522 | pub is_system_key: ::std::os::raw::c_int, 523 | pub character: char16, 524 | pub unmodified_character: char16, 525 | pub focus_on_editable_field: ::std::os::raw::c_int, 526 | } 527 | pub const cef_dom_document_type_t_DOM_DOCUMENT_TYPE_UNKNOWN: cef_dom_document_type_t = 0; 528 | pub const cef_dom_document_type_t_DOM_DOCUMENT_TYPE_HTML: cef_dom_document_type_t = 1; 529 | pub const cef_dom_document_type_t_DOM_DOCUMENT_TYPE_XHTML: cef_dom_document_type_t = 2; 530 | pub const cef_dom_document_type_t_DOM_DOCUMENT_TYPE_PLUGIN: cef_dom_document_type_t = 3; 531 | pub type cef_dom_document_type_t = ::std::os::raw::c_uint; 532 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_UNSUPPORTED: cef_dom_node_type_t = 0; 533 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_ELEMENT: cef_dom_node_type_t = 1; 534 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_ATTRIBUTE: cef_dom_node_type_t = 2; 535 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_TEXT: cef_dom_node_type_t = 3; 536 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_CDATA_SECTION: cef_dom_node_type_t = 4; 537 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS: cef_dom_node_type_t = 5; 538 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_COMMENT: cef_dom_node_type_t = 6; 539 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_DOCUMENT: cef_dom_node_type_t = 7; 540 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_DOCUMENT_TYPE: cef_dom_node_type_t = 8; 541 | pub const cef_dom_node_type_t_DOM_NODE_TYPE_DOCUMENT_FRAGMENT: cef_dom_node_type_t = 9; 542 | pub type cef_dom_node_type_t = ::std::os::raw::c_uint; 543 | pub const cef_file_dialog_mode_t_FILE_DIALOG_OPEN: cef_file_dialog_mode_t = 0; 544 | pub const cef_file_dialog_mode_t_FILE_DIALOG_OPEN_MULTIPLE: cef_file_dialog_mode_t = 1; 545 | pub const cef_file_dialog_mode_t_FILE_DIALOG_OPEN_FOLDER: cef_file_dialog_mode_t = 2; 546 | pub const cef_file_dialog_mode_t_FILE_DIALOG_SAVE: cef_file_dialog_mode_t = 3; 547 | pub const cef_file_dialog_mode_t_FILE_DIALOG_TYPE_MASK: cef_file_dialog_mode_t = 255; 548 | pub const cef_file_dialog_mode_t_FILE_DIALOG_OVERWRITEPROMPT_FLAG: cef_file_dialog_mode_t = 16777216; 549 | pub const cef_file_dialog_mode_t_FILE_DIALOG_HIDEREADONLY_FLAG: cef_file_dialog_mode_t = 33554432; 550 | pub type cef_file_dialog_mode_t = ::std::os::raw::c_uint; 551 | pub const cef_pdf_print_margin_type_t_PDF_PRINT_MARGIN_DEFAULT: cef_pdf_print_margin_type_t = 0; 552 | pub const cef_pdf_print_margin_type_t_PDF_PRINT_MARGIN_NONE: cef_pdf_print_margin_type_t = 1; 553 | pub const cef_pdf_print_margin_type_t_PDF_PRINT_MARGIN_MINIMUM: cef_pdf_print_margin_type_t = 2; 554 | pub const cef_pdf_print_margin_type_t_PDF_PRINT_MARGIN_CUSTOM: cef_pdf_print_margin_type_t = 3; 555 | pub type cef_pdf_print_margin_type_t = ::std::os::raw::c_uint; 556 | #[repr(C)] 557 | pub struct _cef_pdf_print_settings_t { 558 | pub header_footer_title: cef_string_t, 559 | pub header_footer_url: cef_string_t, 560 | pub page_width: ::std::os::raw::c_int, 561 | pub page_height: ::std::os::raw::c_int, 562 | pub scale_factor: ::std::os::raw::c_int, 563 | pub margin_top: f64, 564 | pub margin_right: f64, 565 | pub margin_bottom: f64, 566 | pub margin_left: f64, 567 | pub margin_type: cef_pdf_print_margin_type_t, 568 | pub header_footer_enabled: ::std::os::raw::c_int, 569 | pub selection_only: ::std::os::raw::c_int, 570 | pub landscape: ::std::os::raw::c_int, 571 | pub backgrounds_enabled: ::std::os::raw::c_int, 572 | } 573 | pub const cef_referrer_policy_t_REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE: 574 | cef_referrer_policy_t = 0; 575 | pub const cef_referrer_policy_t_REFERRER_POLICY_DEFAULT: cef_referrer_policy_t = 0; 576 | pub const cef_referrer_policy_t_REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN: 577 | cef_referrer_policy_t = 1; 578 | pub const cef_referrer_policy_t_REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN: cef_referrer_policy_t = 2; 579 | pub const cef_referrer_policy_t_REFERRER_POLICY_NEVER_CLEAR_REFERRER: cef_referrer_policy_t = 3; 580 | pub const cef_referrer_policy_t_REFERRER_POLICY_ORIGIN: cef_referrer_policy_t = 4; 581 | pub const cef_referrer_policy_t_REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN: cef_referrer_policy_t = 5; 582 | pub const cef_referrer_policy_t_REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE: 583 | cef_referrer_policy_t = 6; 584 | pub const cef_referrer_policy_t_REFERRER_POLICY_NO_REFERRER: cef_referrer_policy_t = 7; 585 | pub const cef_referrer_policy_t_REFERRER_POLICY_LAST_VALUE: cef_referrer_policy_t = 7; 586 | pub type cef_referrer_policy_t = ::std::os::raw::c_uint; 587 | pub const cef_color_type_t_CEF_COLOR_TYPE_RGBA_8888: cef_color_type_t = 0; 588 | pub const cef_color_type_t_CEF_COLOR_TYPE_BGRA_8888: cef_color_type_t = 1; 589 | pub type cef_color_type_t = ::std::os::raw::c_uint; 590 | pub const cef_alpha_type_t_CEF_ALPHA_TYPE_OPAQUE: cef_alpha_type_t = 0; 591 | pub const cef_alpha_type_t_CEF_ALPHA_TYPE_PREMULTIPLIED: cef_alpha_type_t = 1; 592 | pub const cef_alpha_type_t_CEF_ALPHA_TYPE_POSTMULTIPLIED: cef_alpha_type_t = 2; 593 | pub type cef_alpha_type_t = ::std::os::raw::c_uint; 594 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_UNKNOWN: cef_ssl_version_t = 0; 595 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_SSL2: cef_ssl_version_t = 1; 596 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_SSL3: cef_ssl_version_t = 2; 597 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_TLS1: cef_ssl_version_t = 3; 598 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_TLS1_1: cef_ssl_version_t = 4; 599 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_TLS1_2: cef_ssl_version_t = 5; 600 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_TLS1_3: cef_ssl_version_t = 6; 601 | pub const cef_ssl_version_t_SSL_CONNECTION_VERSION_QUIC: cef_ssl_version_t = 7; 602 | pub type cef_ssl_version_t = ::std::os::raw::c_uint; 603 | pub const cef_ssl_content_status_t_SSL_CONTENT_NORMAL_CONTENT: cef_ssl_content_status_t = 0; 604 | pub const cef_ssl_content_status_t_SSL_CONTENT_DISPLAYED_INSECURE_CONTENT: cef_ssl_content_status_t = 1; 605 | pub const cef_ssl_content_status_t_SSL_CONTENT_RAN_INSECURE_CONTENT: cef_ssl_content_status_t = 2; 606 | pub type cef_ssl_content_status_t = ::std::os::raw::c_uint; 607 | #[repr(C)] 608 | pub struct _cef_composition_underline_t { 609 | pub range: cef_range_t, 610 | pub color: cef_color_t, 611 | pub background_color: cef_color_t, 612 | pub thick: ::std::os::raw::c_int, 613 | } 614 | pub type cef_composition_underline_t = _cef_composition_underline_t; 615 | #[repr(C)] 616 | pub struct _cef_base_ref_counted_t { 617 | pub size: size_t, 618 | pub add_ref: ::std::option::Option, 619 | pub release: 620 | ::std::option::Option ::std::os::raw::c_int>, 621 | pub has_one_ref: 622 | ::std::option::Option ::std::os::raw::c_int>, 623 | pub has_at_least_one_ref: 624 | ::std::option::Option ::std::os::raw::c_int>, 625 | } 626 | pub type cef_base_ref_counted_t = _cef_base_ref_counted_t; 627 | #[repr(C)] 628 | pub struct _cef_auth_callback_t { 629 | pub base: cef_base_ref_counted_t, 630 | pub cont: ::std::option::Option< 631 | unsafe extern "C" fn( 632 | self_: *mut _cef_auth_callback_t, 633 | username: *const cef_string_t, 634 | password: *const cef_string_t, 635 | ), 636 | >, 637 | pub cancel: ::std::option::Option, 638 | } 639 | #[repr(C)] 640 | pub struct _cef_request_t { 641 | pub base: cef_base_ref_counted_t, 642 | pub is_read_only: ::std::option::Option ::std::os::raw::c_int>, 643 | pub get_url: ::std::option::Option cef_string_userfree_t>, 644 | pub set_url: ::std::option::Option, 645 | pub get_method: ::std::option::Option cef_string_userfree_t>, 646 | pub set_method: 647 | ::std::option::Option, 648 | pub set_referrer: ::std::option::Option< 649 | unsafe extern "C" fn( 650 | self_: *mut _cef_request_t, 651 | referrer_url: *const cef_string_t, 652 | policy: cef_referrer_policy_t, 653 | ), 654 | >, 655 | pub get_referrer_url: 656 | ::std::option::Option cef_string_userfree_t>, 657 | pub get_referrer_policy: 658 | ::std::option::Option cef_referrer_policy_t>, 659 | pub get_post_data: ::std::option::Option *mut _cef_post_data_t>, 660 | pub set_post_data: 661 | ::std::option::Option, 662 | pub get_header_map: 663 | ::std::option::Option, 664 | pub set_header_map: 665 | ::std::option::Option, 666 | pub get_header_by_name: ::std::option::Option< 667 | unsafe extern "C" fn(self_: *mut _cef_request_t, name: *const cef_string_t) -> cef_string_userfree_t, 668 | >, 669 | pub set_header_by_name: ::std::option::Option< 670 | unsafe extern "C" fn( 671 | self_: *mut _cef_request_t, 672 | name: *const cef_string_t, 673 | value: *const cef_string_t, 674 | overwrite: ::std::os::raw::c_int, 675 | ), 676 | >, 677 | pub set: ::std::option::Option< 678 | unsafe extern "C" fn( 679 | self_: *mut _cef_request_t, 680 | url: *const cef_string_t, 681 | method: *const cef_string_t, 682 | postData: *mut _cef_post_data_t, 683 | headerMap: cef_string_multimap_t, 684 | ), 685 | >, 686 | pub get_flags: ::std::option::Option ::std::os::raw::c_int>, 687 | pub set_flags: 688 | ::std::option::Option, 689 | pub get_first_party_for_cookies: 690 | ::std::option::Option cef_string_userfree_t>, 691 | pub set_first_party_for_cookies: 692 | ::std::option::Option, 693 | pub get_resource_type: 694 | ::std::option::Option cef_resource_type_t>, 695 | pub get_transition_type: 696 | ::std::option::Option cef_transition_type_t>, 697 | pub get_identifier: ::std::option::Option uint64>, 698 | } 699 | #[repr(C)] 700 | pub struct _cef_post_data_t { 701 | pub base: cef_base_ref_counted_t, 702 | pub is_read_only: 703 | ::std::option::Option ::std::os::raw::c_int>, 704 | pub has_excluded_elements: 705 | ::std::option::Option ::std::os::raw::c_int>, 706 | pub get_element_count: ::std::option::Option size_t>, 707 | pub get_elements: ::std::option::Option< 708 | unsafe extern "C" fn( 709 | self_: *mut _cef_post_data_t, 710 | elementsCount: *mut size_t, 711 | elements: *mut *mut _cef_post_data_element_t, 712 | ), 713 | >, 714 | pub remove_element: ::std::option::Option< 715 | unsafe extern "C" fn( 716 | self_: *mut _cef_post_data_t, 717 | element: *mut _cef_post_data_element_t, 718 | ) -> ::std::os::raw::c_int, 719 | >, 720 | pub add_element: ::std::option::Option< 721 | unsafe extern "C" fn( 722 | self_: *mut _cef_post_data_t, 723 | element: *mut _cef_post_data_element_t, 724 | ) -> ::std::os::raw::c_int, 725 | >, 726 | pub remove_elements: ::std::option::Option, 727 | } 728 | #[repr(C)] 729 | pub struct _cef_post_data_element_t { 730 | pub base: cef_base_ref_counted_t, 731 | pub is_read_only: 732 | ::std::option::Option ::std::os::raw::c_int>, 733 | pub set_to_empty: ::std::option::Option, 734 | pub set_to_file: ::std::option::Option< 735 | unsafe extern "C" fn(self_: *mut _cef_post_data_element_t, fileName: *const cef_string_t), 736 | >, 737 | pub set_to_bytes: ::std::option::Option< 738 | unsafe extern "C" fn(self_: *mut _cef_post_data_element_t, size: size_t, bytes: *const ::std::os::raw::c_void), 739 | >, 740 | pub get_type: 741 | ::std::option::Option cef_postdataelement_type_t>, 742 | pub get_file: 743 | ::std::option::Option cef_string_userfree_t>, 744 | pub get_bytes_count: ::std::option::Option size_t>, 745 | pub get_bytes: ::std::option::Option< 746 | unsafe extern "C" fn( 747 | self_: *mut _cef_post_data_element_t, 748 | size: size_t, 749 | bytes: *mut ::std::os::raw::c_void, 750 | ) -> size_t, 751 | >, 752 | } 753 | #[repr(C)] 754 | pub struct _cef_completion_callback_t { 755 | pub base: cef_base_ref_counted_t, 756 | pub on_complete: ::std::option::Option, 757 | } 758 | #[repr(C)] 759 | pub struct _cef_cookie_manager_t { 760 | pub base: cef_base_ref_counted_t, 761 | pub set_supported_schemes: ::std::option::Option< 762 | unsafe extern "C" fn( 763 | self_: *mut _cef_cookie_manager_t, 764 | schemes: cef_string_list_t, 765 | include_defaults: ::std::os::raw::c_int, 766 | callback: *mut _cef_completion_callback_t, 767 | ), 768 | >, 769 | pub visit_all_cookies: ::std::option::Option< 770 | unsafe extern "C" fn( 771 | self_: *mut _cef_cookie_manager_t, 772 | visitor: *mut _cef_cookie_visitor_t, 773 | ) -> ::std::os::raw::c_int, 774 | >, 775 | pub visit_url_cookies: ::std::option::Option< 776 | unsafe extern "C" fn( 777 | self_: *mut _cef_cookie_manager_t, 778 | url: *const cef_string_t, 779 | includeHttpOnly: ::std::os::raw::c_int, 780 | visitor: *mut _cef_cookie_visitor_t, 781 | ) -> ::std::os::raw::c_int, 782 | >, 783 | pub set_cookie: ::std::option::Option< 784 | unsafe extern "C" fn( 785 | self_: *mut _cef_cookie_manager_t, 786 | url: *const cef_string_t, 787 | cookie: *const _cef_cookie_t, 788 | callback: *mut _cef_set_cookie_callback_t, 789 | ) -> ::std::os::raw::c_int, 790 | >, 791 | pub delete_cookies: ::std::option::Option< 792 | unsafe extern "C" fn( 793 | self_: *mut _cef_cookie_manager_t, 794 | url: *const cef_string_t, 795 | cookie_name: *const cef_string_t, 796 | callback: *mut _cef_delete_cookies_callback_t, 797 | ) -> ::std::os::raw::c_int, 798 | >, 799 | pub flush_store: ::std::option::Option< 800 | unsafe extern "C" fn( 801 | self_: *mut _cef_cookie_manager_t, 802 | callback: *mut _cef_completion_callback_t, 803 | ) -> ::std::os::raw::c_int, 804 | >, 805 | } 806 | #[repr(C)] 807 | pub struct _cef_cookie_visitor_t { 808 | pub base: cef_base_ref_counted_t, 809 | pub visit: ::std::option::Option< 810 | unsafe extern "C" fn( 811 | self_: *mut _cef_cookie_visitor_t, 812 | cookie: *const _cef_cookie_t, 813 | count: ::std::os::raw::c_int, 814 | total: ::std::os::raw::c_int, 815 | deleteCookie: *mut ::std::os::raw::c_int, 816 | ) -> ::std::os::raw::c_int, 817 | >, 818 | } 819 | #[repr(C)] 820 | pub struct _cef_set_cookie_callback_t { 821 | pub base: cef_base_ref_counted_t, 822 | pub on_complete: ::std::option::Option< 823 | unsafe extern "C" fn(self_: *mut _cef_set_cookie_callback_t, success: ::std::os::raw::c_int), 824 | >, 825 | } 826 | #[repr(C)] 827 | pub struct _cef_delete_cookies_callback_t { 828 | pub base: cef_base_ref_counted_t, 829 | pub on_complete: ::std::option::Option< 830 | unsafe extern "C" fn(self_: *mut _cef_delete_cookies_callback_t, num_deleted: ::std::os::raw::c_int), 831 | >, 832 | } 833 | #[repr(C)] 834 | pub struct _cef_value_t { 835 | pub base: cef_base_ref_counted_t, 836 | pub is_valid: ::std::option::Option ::std::os::raw::c_int>, 837 | pub is_owned: ::std::option::Option ::std::os::raw::c_int>, 838 | pub is_read_only: ::std::option::Option ::std::os::raw::c_int>, 839 | pub is_same: ::std::option::Option< 840 | unsafe extern "C" fn(self_: *mut _cef_value_t, that: *mut _cef_value_t) -> ::std::os::raw::c_int, 841 | >, 842 | pub is_equal: ::std::option::Option< 843 | unsafe extern "C" fn(self_: *mut _cef_value_t, that: *mut _cef_value_t) -> ::std::os::raw::c_int, 844 | >, 845 | pub copy: ::std::option::Option *mut _cef_value_t>, 846 | pub get_type: ::std::option::Option cef_value_type_t>, 847 | pub get_bool: ::std::option::Option ::std::os::raw::c_int>, 848 | pub get_int: ::std::option::Option ::std::os::raw::c_int>, 849 | pub get_double: ::std::option::Option f64>, 850 | pub get_string: ::std::option::Option cef_string_userfree_t>, 851 | pub get_binary: ::std::option::Option *mut _cef_binary_value_t>, 852 | pub get_dictionary: 853 | ::std::option::Option *mut _cef_dictionary_value_t>, 854 | pub get_list: ::std::option::Option *mut _cef_list_value_t>, 855 | pub set_null: ::std::option::Option ::std::os::raw::c_int>, 856 | pub set_bool: ::std::option::Option< 857 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int, 858 | >, 859 | pub set_int: ::std::option::Option< 860 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: ::std::os::raw::c_int) -> ::std::os::raw::c_int, 861 | >, 862 | pub set_double: 863 | ::std::option::Option ::std::os::raw::c_int>, 864 | pub set_string: ::std::option::Option< 865 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: *const cef_string_t) -> ::std::os::raw::c_int, 866 | >, 867 | pub set_binary: ::std::option::Option< 868 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: *mut _cef_binary_value_t) -> ::std::os::raw::c_int, 869 | >, 870 | pub set_dictionary: ::std::option::Option< 871 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: *mut _cef_dictionary_value_t) -> ::std::os::raw::c_int, 872 | >, 873 | pub set_list: ::std::option::Option< 874 | unsafe extern "C" fn(self_: *mut _cef_value_t, value: *mut _cef_list_value_t) -> ::std::os::raw::c_int, 875 | >, 876 | } 877 | #[repr(C)] 878 | pub struct _cef_binary_value_t { 879 | pub base: cef_base_ref_counted_t, 880 | pub is_valid: ::std::option::Option ::std::os::raw::c_int>, 881 | pub is_owned: ::std::option::Option ::std::os::raw::c_int>, 882 | pub is_same: ::std::option::Option< 883 | unsafe extern "C" fn(self_: *mut _cef_binary_value_t, that: *mut _cef_binary_value_t) -> ::std::os::raw::c_int, 884 | >, 885 | pub is_equal: ::std::option::Option< 886 | unsafe extern "C" fn(self_: *mut _cef_binary_value_t, that: *mut _cef_binary_value_t) -> ::std::os::raw::c_int, 887 | >, 888 | pub copy: ::std::option::Option *mut _cef_binary_value_t>, 889 | pub get_size: ::std::option::Option size_t>, 890 | pub get_data: ::std::option::Option< 891 | unsafe extern "C" fn( 892 | self_: *mut _cef_binary_value_t, 893 | buffer: *mut ::std::os::raw::c_void, 894 | buffer_size: size_t, 895 | data_offset: size_t, 896 | ) -> size_t, 897 | >, 898 | } 899 | #[repr(C)] 900 | pub struct _cef_dictionary_value_t { 901 | pub base: cef_base_ref_counted_t, 902 | pub is_valid: 903 | ::std::option::Option ::std::os::raw::c_int>, 904 | pub is_owned: 905 | ::std::option::Option ::std::os::raw::c_int>, 906 | pub is_read_only: 907 | ::std::option::Option ::std::os::raw::c_int>, 908 | pub is_same: ::std::option::Option< 909 | unsafe extern "C" fn( 910 | self_: *mut _cef_dictionary_value_t, 911 | that: *mut _cef_dictionary_value_t, 912 | ) -> ::std::os::raw::c_int, 913 | >, 914 | pub is_equal: ::std::option::Option< 915 | unsafe extern "C" fn( 916 | self_: *mut _cef_dictionary_value_t, 917 | that: *mut _cef_dictionary_value_t, 918 | ) -> ::std::os::raw::c_int, 919 | >, 920 | pub copy: ::std::option::Option< 921 | unsafe extern "C" fn( 922 | self_: *mut _cef_dictionary_value_t, 923 | exclude_empty_children: ::std::os::raw::c_int, 924 | ) -> *mut _cef_dictionary_value_t, 925 | >, 926 | pub get_size: ::std::option::Option size_t>, 927 | pub clear: 928 | ::std::option::Option ::std::os::raw::c_int>, 929 | pub has_key: ::std::option::Option< 930 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> ::std::os::raw::c_int, 931 | >, 932 | pub get_keys: ::std::option::Option< 933 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, keys: cef_string_list_t) -> ::std::os::raw::c_int, 934 | >, 935 | pub remove: ::std::option::Option< 936 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> ::std::os::raw::c_int, 937 | >, 938 | pub get_type: ::std::option::Option< 939 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> cef_value_type_t, 940 | >, 941 | pub get_value: ::std::option::Option< 942 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> *mut _cef_value_t, 943 | >, 944 | pub get_bool: ::std::option::Option< 945 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> ::std::os::raw::c_int, 946 | >, 947 | pub get_int: ::std::option::Option< 948 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> ::std::os::raw::c_int, 949 | >, 950 | pub get_double: ::std::option::Option< 951 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> f64, 952 | >, 953 | pub get_string: ::std::option::Option< 954 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> cef_string_userfree_t, 955 | >, 956 | pub get_binary: ::std::option::Option< 957 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> *mut _cef_binary_value_t, 958 | >, 959 | pub get_dictionary: ::std::option::Option< 960 | unsafe extern "C" fn( 961 | self_: *mut _cef_dictionary_value_t, 962 | key: *const cef_string_t, 963 | ) -> *mut _cef_dictionary_value_t, 964 | >, 965 | pub get_list: ::std::option::Option< 966 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> *mut _cef_list_value_t, 967 | >, 968 | pub set_value: ::std::option::Option< 969 | unsafe extern "C" fn( 970 | self_: *mut _cef_dictionary_value_t, 971 | key: *const cef_string_t, 972 | value: *mut _cef_value_t, 973 | ) -> ::std::os::raw::c_int, 974 | >, 975 | pub set_null: ::std::option::Option< 976 | unsafe extern "C" fn(self_: *mut _cef_dictionary_value_t, key: *const cef_string_t) -> ::std::os::raw::c_int, 977 | >, 978 | pub set_bool: ::std::option::Option< 979 | unsafe extern "C" fn( 980 | self_: *mut _cef_dictionary_value_t, 981 | key: *const cef_string_t, 982 | value: ::std::os::raw::c_int, 983 | ) -> ::std::os::raw::c_int, 984 | >, 985 | pub set_int: ::std::option::Option< 986 | unsafe extern "C" fn( 987 | self_: *mut _cef_dictionary_value_t, 988 | key: *const cef_string_t, 989 | value: ::std::os::raw::c_int, 990 | ) -> ::std::os::raw::c_int, 991 | >, 992 | pub set_double: ::std::option::Option< 993 | unsafe extern "C" fn( 994 | self_: *mut _cef_dictionary_value_t, 995 | key: *const cef_string_t, 996 | value: f64, 997 | ) -> ::std::os::raw::c_int, 998 | >, 999 | pub set_string: ::std::option::Option< 1000 | unsafe extern "C" fn( 1001 | self_: *mut _cef_dictionary_value_t, 1002 | key: *const cef_string_t, 1003 | value: *const cef_string_t, 1004 | ) -> ::std::os::raw::c_int, 1005 | >, 1006 | pub set_binary: ::std::option::Option< 1007 | unsafe extern "C" fn( 1008 | self_: *mut _cef_dictionary_value_t, 1009 | key: *const cef_string_t, 1010 | value: *mut _cef_binary_value_t, 1011 | ) -> ::std::os::raw::c_int, 1012 | >, 1013 | pub set_dictionary: ::std::option::Option< 1014 | unsafe extern "C" fn( 1015 | self_: *mut _cef_dictionary_value_t, 1016 | key: *const cef_string_t, 1017 | value: *mut _cef_dictionary_value_t, 1018 | ) -> ::std::os::raw::c_int, 1019 | >, 1020 | pub set_list: ::std::option::Option< 1021 | unsafe extern "C" fn( 1022 | self_: *mut _cef_dictionary_value_t, 1023 | key: *const cef_string_t, 1024 | value: *mut _cef_list_value_t, 1025 | ) -> ::std::os::raw::c_int, 1026 | >, 1027 | } 1028 | #[repr(C)] 1029 | pub struct _cef_list_value_t { 1030 | pub base: cef_base_ref_counted_t, 1031 | pub is_valid: ::std::option::Option ::std::os::raw::c_int>, 1032 | pub is_owned: ::std::option::Option ::std::os::raw::c_int>, 1033 | pub is_read_only: 1034 | ::std::option::Option ::std::os::raw::c_int>, 1035 | pub is_same: ::std::option::Option< 1036 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, that: *mut _cef_list_value_t) -> ::std::os::raw::c_int, 1037 | >, 1038 | pub is_equal: ::std::option::Option< 1039 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, that: *mut _cef_list_value_t) -> ::std::os::raw::c_int, 1040 | >, 1041 | pub copy: ::std::option::Option *mut _cef_list_value_t>, 1042 | pub set_size: ::std::option::Option< 1043 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, size: size_t) -> ::std::os::raw::c_int, 1044 | >, 1045 | pub get_size: ::std::option::Option size_t>, 1046 | pub clear: ::std::option::Option ::std::os::raw::c_int>, 1047 | pub remove: ::std::option::Option< 1048 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> ::std::os::raw::c_int, 1049 | >, 1050 | pub get_type: 1051 | ::std::option::Option cef_value_type_t>, 1052 | pub get_value: 1053 | ::std::option::Option *mut _cef_value_t>, 1054 | pub get_bool: ::std::option::Option< 1055 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> ::std::os::raw::c_int, 1056 | >, 1057 | pub get_int: ::std::option::Option< 1058 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> ::std::os::raw::c_int, 1059 | >, 1060 | pub get_double: ::std::option::Option f64>, 1061 | pub get_string: ::std::option::Option< 1062 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> cef_string_userfree_t, 1063 | >, 1064 | pub get_binary: ::std::option::Option< 1065 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> *mut _cef_binary_value_t, 1066 | >, 1067 | pub get_dictionary: ::std::option::Option< 1068 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> *mut _cef_dictionary_value_t, 1069 | >, 1070 | pub get_list: ::std::option::Option< 1071 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> *mut _cef_list_value_t, 1072 | >, 1073 | pub set_value: ::std::option::Option< 1074 | unsafe extern "C" fn( 1075 | self_: *mut _cef_list_value_t, 1076 | index: size_t, 1077 | value: *mut _cef_value_t, 1078 | ) -> ::std::os::raw::c_int, 1079 | >, 1080 | pub set_null: ::std::option::Option< 1081 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t) -> ::std::os::raw::c_int, 1082 | >, 1083 | pub set_bool: ::std::option::Option< 1084 | unsafe extern "C" fn( 1085 | self_: *mut _cef_list_value_t, 1086 | index: size_t, 1087 | value: ::std::os::raw::c_int, 1088 | ) -> ::std::os::raw::c_int, 1089 | >, 1090 | pub set_int: ::std::option::Option< 1091 | unsafe extern "C" fn( 1092 | self_: *mut _cef_list_value_t, 1093 | index: size_t, 1094 | value: ::std::os::raw::c_int, 1095 | ) -> ::std::os::raw::c_int, 1096 | >, 1097 | pub set_double: ::std::option::Option< 1098 | unsafe extern "C" fn(self_: *mut _cef_list_value_t, index: size_t, value: f64) -> ::std::os::raw::c_int, 1099 | >, 1100 | pub set_string: ::std::option::Option< 1101 | unsafe extern "C" fn( 1102 | self_: *mut _cef_list_value_t, 1103 | index: size_t, 1104 | value: *const cef_string_t, 1105 | ) -> ::std::os::raw::c_int, 1106 | >, 1107 | pub set_binary: ::std::option::Option< 1108 | unsafe extern "C" fn( 1109 | self_: *mut _cef_list_value_t, 1110 | index: size_t, 1111 | value: *mut _cef_binary_value_t, 1112 | ) -> ::std::os::raw::c_int, 1113 | >, 1114 | pub set_dictionary: ::std::option::Option< 1115 | unsafe extern "C" fn( 1116 | self_: *mut _cef_list_value_t, 1117 | index: size_t, 1118 | value: *mut _cef_dictionary_value_t, 1119 | ) -> ::std::os::raw::c_int, 1120 | >, 1121 | pub set_list: ::std::option::Option< 1122 | unsafe extern "C" fn( 1123 | self_: *mut _cef_list_value_t, 1124 | index: size_t, 1125 | value: *mut _cef_list_value_t, 1126 | ) -> ::std::os::raw::c_int, 1127 | >, 1128 | } 1129 | #[repr(C)] 1130 | pub struct _cef_extension_t { 1131 | pub base: cef_base_ref_counted_t, 1132 | pub get_identifier: 1133 | ::std::option::Option cef_string_userfree_t>, 1134 | pub get_path: ::std::option::Option cef_string_userfree_t>, 1135 | pub get_manifest: 1136 | ::std::option::Option *mut _cef_dictionary_value_t>, 1137 | pub is_same: ::std::option::Option< 1138 | unsafe extern "C" fn(self_: *mut _cef_extension_t, that: *mut _cef_extension_t) -> ::std::os::raw::c_int, 1139 | >, 1140 | pub get_handler: 1141 | ::std::option::Option *mut _cef_extension_handler_t>, 1142 | pub get_loader_context: 1143 | ::std::option::Option *mut _cef_request_context_t>, 1144 | pub is_loaded: ::std::option::Option ::std::os::raw::c_int>, 1145 | pub unload: ::std::option::Option, 1146 | } 1147 | #[repr(C)] 1148 | pub struct _cef_image_t { 1149 | pub base: cef_base_ref_counted_t, 1150 | pub is_empty: ::std::option::Option ::std::os::raw::c_int>, 1151 | pub is_same: ::std::option::Option< 1152 | unsafe extern "C" fn(self_: *mut _cef_image_t, that: *mut _cef_image_t) -> ::std::os::raw::c_int, 1153 | >, 1154 | pub add_bitmap: ::std::option::Option< 1155 | unsafe extern "C" fn( 1156 | self_: *mut _cef_image_t, 1157 | scale_factor: f32, 1158 | pixel_width: ::std::os::raw::c_int, 1159 | pixel_height: ::std::os::raw::c_int, 1160 | color_type: cef_color_type_t, 1161 | alpha_type: cef_alpha_type_t, 1162 | pixel_data: *const ::std::os::raw::c_void, 1163 | pixel_data_size: size_t, 1164 | ) -> ::std::os::raw::c_int, 1165 | >, 1166 | pub add_png: ::std::option::Option< 1167 | unsafe extern "C" fn( 1168 | self_: *mut _cef_image_t, 1169 | scale_factor: f32, 1170 | png_data: *const ::std::os::raw::c_void, 1171 | png_data_size: size_t, 1172 | ) -> ::std::os::raw::c_int, 1173 | >, 1174 | pub add_jpeg: ::std::option::Option< 1175 | unsafe extern "C" fn( 1176 | self_: *mut _cef_image_t, 1177 | scale_factor: f32, 1178 | jpeg_data: *const ::std::os::raw::c_void, 1179 | jpeg_data_size: size_t, 1180 | ) -> ::std::os::raw::c_int, 1181 | >, 1182 | pub get_width: ::std::option::Option size_t>, 1183 | pub get_height: ::std::option::Option size_t>, 1184 | pub has_representation: ::std::option::Option< 1185 | unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> ::std::os::raw::c_int, 1186 | >, 1187 | pub remove_representation: ::std::option::Option< 1188 | unsafe extern "C" fn(self_: *mut _cef_image_t, scale_factor: f32) -> ::std::os::raw::c_int, 1189 | >, 1190 | pub get_representation_info: ::std::option::Option< 1191 | unsafe extern "C" fn( 1192 | self_: *mut _cef_image_t, 1193 | scale_factor: f32, 1194 | actual_scale_factor: *mut f32, 1195 | pixel_width: *mut ::std::os::raw::c_int, 1196 | pixel_height: *mut ::std::os::raw::c_int, 1197 | ) -> ::std::os::raw::c_int, 1198 | >, 1199 | pub get_as_bitmap: ::std::option::Option< 1200 | unsafe extern "C" fn( 1201 | self_: *mut _cef_image_t, 1202 | scale_factor: f32, 1203 | color_type: cef_color_type_t, 1204 | alpha_type: cef_alpha_type_t, 1205 | pixel_width: *mut ::std::os::raw::c_int, 1206 | pixel_height: *mut ::std::os::raw::c_int, 1207 | ) -> *mut _cef_binary_value_t, 1208 | >, 1209 | pub get_as_png: ::std::option::Option< 1210 | unsafe extern "C" fn( 1211 | self_: *mut _cef_image_t, 1212 | scale_factor: f32, 1213 | with_transparency: ::std::os::raw::c_int, 1214 | pixel_width: *mut ::std::os::raw::c_int, 1215 | pixel_height: *mut ::std::os::raw::c_int, 1216 | ) -> *mut _cef_binary_value_t, 1217 | >, 1218 | pub get_as_jpeg: ::std::option::Option< 1219 | unsafe extern "C" fn( 1220 | self_: *mut _cef_image_t, 1221 | scale_factor: f32, 1222 | quality: ::std::os::raw::c_int, 1223 | pixel_width: *mut ::std::os::raw::c_int, 1224 | pixel_height: *mut ::std::os::raw::c_int, 1225 | ) -> *mut _cef_binary_value_t, 1226 | >, 1227 | } 1228 | #[repr(C)] 1229 | pub struct _cef_stream_reader_t { 1230 | pub base: cef_base_ref_counted_t, 1231 | pub read: ::std::option::Option< 1232 | unsafe extern "C" fn( 1233 | self_: *mut _cef_stream_reader_t, 1234 | ptr: *mut ::std::os::raw::c_void, 1235 | size: size_t, 1236 | n: size_t, 1237 | ) -> size_t, 1238 | >, 1239 | pub seek: ::std::option::Option< 1240 | unsafe extern "C" fn( 1241 | self_: *mut _cef_stream_reader_t, 1242 | offset: int64, 1243 | whence: ::std::os::raw::c_int, 1244 | ) -> ::std::os::raw::c_int, 1245 | >, 1246 | pub tell: ::std::option::Option int64>, 1247 | pub eof: ::std::option::Option ::std::os::raw::c_int>, 1248 | pub may_block: 1249 | ::std::option::Option ::std::os::raw::c_int>, 1250 | } 1251 | #[repr(C)] 1252 | pub struct _cef_stream_writer_t { 1253 | pub base: cef_base_ref_counted_t, 1254 | pub write: ::std::option::Option< 1255 | unsafe extern "C" fn( 1256 | self_: *mut _cef_stream_writer_t, 1257 | ptr: *const ::std::os::raw::c_void, 1258 | size: size_t, 1259 | n: size_t, 1260 | ) -> size_t, 1261 | >, 1262 | pub seek: ::std::option::Option< 1263 | unsafe extern "C" fn( 1264 | self_: *mut _cef_stream_writer_t, 1265 | offset: int64, 1266 | whence: ::std::os::raw::c_int, 1267 | ) -> ::std::os::raw::c_int, 1268 | >, 1269 | pub tell: ::std::option::Option int64>, 1270 | pub flush: ::std::option::Option ::std::os::raw::c_int>, 1271 | pub may_block: 1272 | ::std::option::Option ::std::os::raw::c_int>, 1273 | } 1274 | #[repr(C)] 1275 | pub struct _cef_drag_data_t { 1276 | pub base: cef_base_ref_counted_t, 1277 | pub clone: ::std::option::Option *mut _cef_drag_data_t>, 1278 | pub is_read_only: 1279 | ::std::option::Option ::std::os::raw::c_int>, 1280 | pub is_link: ::std::option::Option ::std::os::raw::c_int>, 1281 | pub is_fragment: ::std::option::Option ::std::os::raw::c_int>, 1282 | pub is_file: ::std::option::Option ::std::os::raw::c_int>, 1283 | pub get_link_url: 1284 | ::std::option::Option cef_string_userfree_t>, 1285 | pub get_link_title: 1286 | ::std::option::Option cef_string_userfree_t>, 1287 | pub get_link_metadata: 1288 | ::std::option::Option cef_string_userfree_t>, 1289 | pub get_fragment_text: 1290 | ::std::option::Option cef_string_userfree_t>, 1291 | pub get_fragment_html: 1292 | ::std::option::Option cef_string_userfree_t>, 1293 | pub get_fragment_base_url: 1294 | ::std::option::Option cef_string_userfree_t>, 1295 | pub get_file_name: 1296 | ::std::option::Option cef_string_userfree_t>, 1297 | pub get_file_contents: ::std::option::Option< 1298 | unsafe extern "C" fn(self_: *mut _cef_drag_data_t, writer: *mut _cef_stream_writer_t) -> size_t, 1299 | >, 1300 | pub get_file_names: ::std::option::Option< 1301 | unsafe extern "C" fn(self_: *mut _cef_drag_data_t, names: cef_string_list_t) -> ::std::os::raw::c_int, 1302 | >, 1303 | pub set_link_url: 1304 | ::std::option::Option, 1305 | pub set_link_title: 1306 | ::std::option::Option, 1307 | pub set_link_metadata: 1308 | ::std::option::Option, 1309 | pub set_fragment_text: 1310 | ::std::option::Option, 1311 | pub set_fragment_html: 1312 | ::std::option::Option, 1313 | pub set_fragment_base_url: 1314 | ::std::option::Option, 1315 | pub reset_file_contents: ::std::option::Option, 1316 | pub add_file: ::std::option::Option< 1317 | unsafe extern "C" fn( 1318 | self_: *mut _cef_drag_data_t, 1319 | path: *const cef_string_t, 1320 | display_name: *const cef_string_t, 1321 | ), 1322 | >, 1323 | pub get_image: ::std::option::Option *mut _cef_image_t>, 1324 | pub get_image_hotspot: ::std::option::Option cef_point_t>, 1325 | pub has_image: ::std::option::Option ::std::os::raw::c_int>, 1326 | } 1327 | #[repr(C)] 1328 | pub struct _cef_domvisitor_t { 1329 | pub base: cef_base_ref_counted_t, 1330 | pub visit: 1331 | ::std::option::Option, 1332 | } 1333 | #[repr(C)] 1334 | pub struct _cef_domdocument_t { 1335 | pub base: cef_base_ref_counted_t, 1336 | pub get_type: 1337 | ::std::option::Option cef_dom_document_type_t>, 1338 | pub get_document: 1339 | ::std::option::Option *mut _cef_domnode_t>, 1340 | pub get_body: ::std::option::Option *mut _cef_domnode_t>, 1341 | pub get_head: ::std::option::Option *mut _cef_domnode_t>, 1342 | pub get_title: ::std::option::Option cef_string_userfree_t>, 1343 | pub get_element_by_id: ::std::option::Option< 1344 | unsafe extern "C" fn(self_: *mut _cef_domdocument_t, id: *const cef_string_t) -> *mut _cef_domnode_t, 1345 | >, 1346 | pub get_focused_node: 1347 | ::std::option::Option *mut _cef_domnode_t>, 1348 | pub has_selection: 1349 | ::std::option::Option ::std::os::raw::c_int>, 1350 | pub get_selection_start_offset: 1351 | ::std::option::Option ::std::os::raw::c_int>, 1352 | pub get_selection_end_offset: 1353 | ::std::option::Option ::std::os::raw::c_int>, 1354 | pub get_selection_as_markup: 1355 | ::std::option::Option cef_string_userfree_t>, 1356 | pub get_selection_as_text: 1357 | ::std::option::Option cef_string_userfree_t>, 1358 | pub get_base_url: 1359 | ::std::option::Option cef_string_userfree_t>, 1360 | pub get_complete_url: ::std::option::Option< 1361 | unsafe extern "C" fn(self_: *mut _cef_domdocument_t, partialURL: *const cef_string_t) -> cef_string_userfree_t, 1362 | >, 1363 | } 1364 | #[repr(C)] 1365 | pub struct _cef_domnode_t { 1366 | pub base: cef_base_ref_counted_t, 1367 | pub get_type: ::std::option::Option cef_dom_node_type_t>, 1368 | pub is_text: ::std::option::Option ::std::os::raw::c_int>, 1369 | pub is_element: ::std::option::Option ::std::os::raw::c_int>, 1370 | pub is_editable: ::std::option::Option ::std::os::raw::c_int>, 1371 | pub is_form_control_element: 1372 | ::std::option::Option ::std::os::raw::c_int>, 1373 | pub get_form_control_element_type: 1374 | ::std::option::Option cef_string_userfree_t>, 1375 | pub is_same: ::std::option::Option< 1376 | unsafe extern "C" fn(self_: *mut _cef_domnode_t, that: *mut _cef_domnode_t) -> ::std::os::raw::c_int, 1377 | >, 1378 | pub get_name: ::std::option::Option cef_string_userfree_t>, 1379 | pub get_value: ::std::option::Option cef_string_userfree_t>, 1380 | pub set_value: ::std::option::Option< 1381 | unsafe extern "C" fn(self_: *mut _cef_domnode_t, value: *const cef_string_t) -> ::std::os::raw::c_int, 1382 | >, 1383 | pub get_as_markup: ::std::option::Option cef_string_userfree_t>, 1384 | pub get_document: 1385 | ::std::option::Option *mut _cef_domdocument_t>, 1386 | pub get_parent: ::std::option::Option *mut _cef_domnode_t>, 1387 | pub get_previous_sibling: 1388 | ::std::option::Option *mut _cef_domnode_t>, 1389 | pub get_next_sibling: 1390 | ::std::option::Option *mut _cef_domnode_t>, 1391 | pub has_children: ::std::option::Option ::std::os::raw::c_int>, 1392 | pub get_first_child: ::std::option::Option *mut _cef_domnode_t>, 1393 | pub get_last_child: ::std::option::Option *mut _cef_domnode_t>, 1394 | pub get_element_tag_name: 1395 | ::std::option::Option cef_string_userfree_t>, 1396 | pub has_element_attributes: 1397 | ::std::option::Option ::std::os::raw::c_int>, 1398 | pub has_element_attribute: ::std::option::Option< 1399 | unsafe extern "C" fn(self_: *mut _cef_domnode_t, attrName: *const cef_string_t) -> ::std::os::raw::c_int, 1400 | >, 1401 | pub get_element_attribute: ::std::option::Option< 1402 | unsafe extern "C" fn(self_: *mut _cef_domnode_t, attrName: *const cef_string_t) -> cef_string_userfree_t, 1403 | >, 1404 | pub get_element_attributes: 1405 | ::std::option::Option, 1406 | pub set_element_attribute: ::std::option::Option< 1407 | unsafe extern "C" fn( 1408 | self_: *mut _cef_domnode_t, 1409 | attrName: *const cef_string_t, 1410 | value: *const cef_string_t, 1411 | ) -> ::std::os::raw::c_int, 1412 | >, 1413 | pub get_element_inner_text: 1414 | ::std::option::Option cef_string_userfree_t>, 1415 | pub get_element_bounds: ::std::option::Option cef_rect_t>, 1416 | } 1417 | #[repr(C)] 1418 | pub struct _cef_process_message_t { 1419 | pub base: cef_base_ref_counted_t, 1420 | pub is_valid: 1421 | ::std::option::Option ::std::os::raw::c_int>, 1422 | pub is_read_only: 1423 | ::std::option::Option ::std::os::raw::c_int>, 1424 | pub copy: 1425 | ::std::option::Option *mut _cef_process_message_t>, 1426 | pub get_name: 1427 | ::std::option::Option cef_string_userfree_t>, 1428 | pub get_argument_list: 1429 | ::std::option::Option *mut _cef_list_value_t>, 1430 | } 1431 | #[repr(C)] 1432 | pub struct _cef_string_visitor_t { 1433 | pub base: cef_base_ref_counted_t, 1434 | pub visit: 1435 | ::std::option::Option, 1436 | } 1437 | #[repr(C)] 1438 | pub struct _cef_v8context_t { 1439 | _unused: [u8; 0], 1440 | } 1441 | #[repr(C)] 1442 | pub struct _cef_frame_t { 1443 | pub base: cef_base_ref_counted_t, 1444 | pub is_valid: ::std::option::Option ::std::os::raw::c_int>, 1445 | pub undo: ::std::option::Option, 1446 | pub redo: ::std::option::Option, 1447 | pub cut: ::std::option::Option, 1448 | pub copy: ::std::option::Option, 1449 | pub paste: ::std::option::Option, 1450 | pub del: ::std::option::Option, 1451 | pub select_all: ::std::option::Option, 1452 | pub view_source: ::std::option::Option, 1453 | pub get_source: 1454 | ::std::option::Option, 1455 | pub get_text: 1456 | ::std::option::Option, 1457 | pub load_request: 1458 | ::std::option::Option, 1459 | pub load_url: ::std::option::Option, 1460 | pub execute_java_script: ::std::option::Option< 1461 | unsafe extern "C" fn( 1462 | self_: *mut _cef_frame_t, 1463 | code: *const cef_string_t, 1464 | script_url: *const cef_string_t, 1465 | start_line: ::std::os::raw::c_int, 1466 | ), 1467 | >, 1468 | pub is_main: ::std::option::Option ::std::os::raw::c_int>, 1469 | pub is_focused: ::std::option::Option ::std::os::raw::c_int>, 1470 | pub get_name: ::std::option::Option cef_string_userfree_t>, 1471 | pub get_identifier: ::std::option::Option int64>, 1472 | pub get_parent: ::std::option::Option *mut _cef_frame_t>, 1473 | pub get_url: ::std::option::Option cef_string_userfree_t>, 1474 | pub get_browser: ::std::option::Option *mut _cef_browser_t>, 1475 | pub get_v8context: ::std::option::Option *mut _cef_v8context_t>, 1476 | pub visit_dom: 1477 | ::std::option::Option, 1478 | pub create_urlrequest: ::std::option::Option< 1479 | unsafe extern "C" fn( 1480 | self_: *mut _cef_frame_t, 1481 | request: *mut _cef_request_t, 1482 | client: *mut _cef_urlrequest_client_t, 1483 | ) -> *mut _cef_urlrequest_t, 1484 | >, 1485 | pub send_process_message: ::std::option::Option< 1486 | unsafe extern "C" fn( 1487 | self_: *mut _cef_frame_t, 1488 | target_process: cef_process_id_t, 1489 | message: *mut _cef_process_message_t, 1490 | ), 1491 | >, 1492 | } 1493 | #[repr(C)] 1494 | pub struct _cef_x509cert_principal_t { 1495 | pub base: cef_base_ref_counted_t, 1496 | pub get_display_name: 1497 | ::std::option::Option cef_string_userfree_t>, 1498 | pub get_common_name: 1499 | ::std::option::Option cef_string_userfree_t>, 1500 | pub get_locality_name: 1501 | ::std::option::Option cef_string_userfree_t>, 1502 | pub get_state_or_province_name: 1503 | ::std::option::Option cef_string_userfree_t>, 1504 | pub get_country_name: 1505 | ::std::option::Option cef_string_userfree_t>, 1506 | pub get_street_addresses: ::std::option::Option< 1507 | unsafe extern "C" fn(self_: *mut _cef_x509cert_principal_t, addresses: cef_string_list_t), 1508 | >, 1509 | pub get_organization_names: 1510 | ::std::option::Option, 1511 | pub get_organization_unit_names: 1512 | ::std::option::Option, 1513 | pub get_domain_components: ::std::option::Option< 1514 | unsafe extern "C" fn(self_: *mut _cef_x509cert_principal_t, components: cef_string_list_t), 1515 | >, 1516 | } 1517 | #[repr(C)] 1518 | pub struct _cef_x509certificate_t { 1519 | pub base: cef_base_ref_counted_t, 1520 | pub get_subject: ::std::option::Option< 1521 | unsafe extern "C" fn(self_: *mut _cef_x509certificate_t) -> *mut _cef_x509cert_principal_t, 1522 | >, 1523 | pub get_issuer: ::std::option::Option< 1524 | unsafe extern "C" fn(self_: *mut _cef_x509certificate_t) -> *mut _cef_x509cert_principal_t, 1525 | >, 1526 | pub get_serial_number: 1527 | ::std::option::Option *mut _cef_binary_value_t>, 1528 | pub get_valid_start: ::std::option::Option cef_time_t>, 1529 | pub get_valid_expiry: ::std::option::Option cef_time_t>, 1530 | pub get_derencoded: 1531 | ::std::option::Option *mut _cef_binary_value_t>, 1532 | pub get_pemencoded: 1533 | ::std::option::Option *mut _cef_binary_value_t>, 1534 | pub get_issuer_chain_size: 1535 | ::std::option::Option size_t>, 1536 | pub get_derencoded_issuer_chain: ::std::option::Option< 1537 | unsafe extern "C" fn( 1538 | self_: *mut _cef_x509certificate_t, 1539 | chainCount: *mut size_t, 1540 | chain: *mut *mut _cef_binary_value_t, 1541 | ), 1542 | >, 1543 | pub get_pemencoded_issuer_chain: ::std::option::Option< 1544 | unsafe extern "C" fn( 1545 | self_: *mut _cef_x509certificate_t, 1546 | chainCount: *mut size_t, 1547 | chain: *mut *mut _cef_binary_value_t, 1548 | ), 1549 | >, 1550 | } 1551 | #[repr(C)] 1552 | pub struct _cef_sslstatus_t { 1553 | pub base: cef_base_ref_counted_t, 1554 | pub is_secure_connection: 1555 | ::std::option::Option ::std::os::raw::c_int>, 1556 | pub get_cert_status: ::std::option::Option cef_cert_status_t>, 1557 | pub get_sslversion: ::std::option::Option cef_ssl_version_t>, 1558 | pub get_content_status: 1559 | ::std::option::Option cef_ssl_content_status_t>, 1560 | pub get_x509certificate: 1561 | ::std::option::Option *mut _cef_x509certificate_t>, 1562 | } 1563 | #[repr(C)] 1564 | pub struct _cef_navigation_entry_t { 1565 | pub base: cef_base_ref_counted_t, 1566 | pub is_valid: 1567 | ::std::option::Option ::std::os::raw::c_int>, 1568 | pub get_url: 1569 | ::std::option::Option cef_string_userfree_t>, 1570 | pub get_display_url: 1571 | ::std::option::Option cef_string_userfree_t>, 1572 | pub get_original_url: 1573 | ::std::option::Option cef_string_userfree_t>, 1574 | pub get_title: 1575 | ::std::option::Option cef_string_userfree_t>, 1576 | pub get_transition_type: 1577 | ::std::option::Option cef_transition_type_t>, 1578 | pub has_post_data: 1579 | ::std::option::Option ::std::os::raw::c_int>, 1580 | pub get_completion_time: 1581 | ::std::option::Option cef_time_t>, 1582 | pub get_http_status_code: 1583 | ::std::option::Option ::std::os::raw::c_int>, 1584 | pub get_sslstatus: 1585 | ::std::option::Option *mut _cef_sslstatus_t>, 1586 | } 1587 | #[repr(C)] 1588 | pub struct _cef_client_t { 1589 | _unused: [u8; 0], 1590 | } 1591 | #[repr(C)] 1592 | pub struct _cef_browser_t { 1593 | pub base: cef_base_ref_counted_t, 1594 | pub get_host: ::std::option::Option *mut _cef_browser_host_t>, 1595 | pub can_go_back: ::std::option::Option ::std::os::raw::c_int>, 1596 | pub go_back: ::std::option::Option, 1597 | pub can_go_forward: 1598 | ::std::option::Option ::std::os::raw::c_int>, 1599 | pub go_forward: ::std::option::Option, 1600 | pub is_loading: ::std::option::Option ::std::os::raw::c_int>, 1601 | pub reload: ::std::option::Option, 1602 | pub reload_ignore_cache: ::std::option::Option, 1603 | pub stop_load: ::std::option::Option, 1604 | pub get_identifier: 1605 | ::std::option::Option ::std::os::raw::c_int>, 1606 | pub is_same: ::std::option::Option< 1607 | unsafe extern "C" fn(self_: *mut _cef_browser_t, that: *mut _cef_browser_t) -> ::std::os::raw::c_int, 1608 | >, 1609 | pub is_popup: ::std::option::Option ::std::os::raw::c_int>, 1610 | pub has_document: ::std::option::Option ::std::os::raw::c_int>, 1611 | pub get_main_frame: ::std::option::Option *mut _cef_frame_t>, 1612 | pub get_focused_frame: ::std::option::Option *mut _cef_frame_t>, 1613 | pub get_frame_byident: 1614 | ::std::option::Option *mut _cef_frame_t>, 1615 | pub get_frame: ::std::option::Option< 1616 | unsafe extern "C" fn(self_: *mut _cef_browser_t, name: *const cef_string_t) -> *mut _cef_frame_t, 1617 | >, 1618 | pub get_frame_count: ::std::option::Option size_t>, 1619 | pub get_frame_identifiers: ::std::option::Option< 1620 | unsafe extern "C" fn(self_: *mut _cef_browser_t, identifiersCount: *mut size_t, identifiers: *mut int64), 1621 | >, 1622 | pub get_frame_names: 1623 | ::std::option::Option, 1624 | } 1625 | #[repr(C)] 1626 | pub struct _cef_run_file_dialog_callback_t { 1627 | pub base: cef_base_ref_counted_t, 1628 | pub on_file_dialog_dismissed: ::std::option::Option< 1629 | unsafe extern "C" fn( 1630 | self_: *mut _cef_run_file_dialog_callback_t, 1631 | selected_accept_filter: ::std::os::raw::c_int, 1632 | file_paths: cef_string_list_t, 1633 | ), 1634 | >, 1635 | } 1636 | #[repr(C)] 1637 | pub struct _cef_navigation_entry_visitor_t { 1638 | pub base: cef_base_ref_counted_t, 1639 | pub visit: ::std::option::Option< 1640 | unsafe extern "C" fn( 1641 | self_: *mut _cef_navigation_entry_visitor_t, 1642 | entry: *mut _cef_navigation_entry_t, 1643 | current: ::std::os::raw::c_int, 1644 | index: ::std::os::raw::c_int, 1645 | total: ::std::os::raw::c_int, 1646 | ) -> ::std::os::raw::c_int, 1647 | >, 1648 | } 1649 | #[repr(C)] 1650 | pub struct _cef_pdf_print_callback_t { 1651 | pub base: cef_base_ref_counted_t, 1652 | pub on_pdf_print_finished: ::std::option::Option< 1653 | unsafe extern "C" fn( 1654 | self_: *mut _cef_pdf_print_callback_t, 1655 | path: *const cef_string_t, 1656 | ok: ::std::os::raw::c_int, 1657 | ), 1658 | >, 1659 | } 1660 | #[repr(C)] 1661 | pub struct _cef_download_image_callback_t { 1662 | pub base: cef_base_ref_counted_t, 1663 | pub on_download_image_finished: ::std::option::Option< 1664 | unsafe extern "C" fn( 1665 | self_: *mut _cef_download_image_callback_t, 1666 | image_url: *const cef_string_t, 1667 | http_status_code: ::std::os::raw::c_int, 1668 | image: *mut _cef_image_t, 1669 | ), 1670 | >, 1671 | } 1672 | #[repr(C)] 1673 | pub struct _cef_browser_host_t { 1674 | pub base: cef_base_ref_counted_t, 1675 | pub get_browser: 1676 | ::std::option::Option *mut _cef_browser_t>, 1677 | pub close_browser: ::std::option::Option< 1678 | unsafe extern "C" fn(self_: *mut _cef_browser_host_t, force_close: ::std::os::raw::c_int), 1679 | >, 1680 | pub try_close_browser: 1681 | ::std::option::Option ::std::os::raw::c_int>, 1682 | pub set_focus: 1683 | ::std::option::Option, 1684 | pub get_window_handle: 1685 | ::std::option::Option ::std::os::raw::c_ulong>, 1686 | pub get_opener_window_handle: 1687 | ::std::option::Option ::std::os::raw::c_ulong>, 1688 | pub has_view: ::std::option::Option ::std::os::raw::c_int>, 1689 | pub get_client: ::std::option::Option *mut _cef_client_t>, 1690 | pub get_request_context: 1691 | ::std::option::Option *mut _cef_request_context_t>, 1692 | pub get_zoom_level: ::std::option::Option f64>, 1693 | pub set_zoom_level: ::std::option::Option, 1694 | pub run_file_dialog: ::std::option::Option< 1695 | unsafe extern "C" fn( 1696 | self_: *mut _cef_browser_host_t, 1697 | mode: cef_file_dialog_mode_t, 1698 | title: *const cef_string_t, 1699 | default_file_path: *const cef_string_t, 1700 | accept_filters: cef_string_list_t, 1701 | selected_accept_filter: ::std::os::raw::c_int, 1702 | callback: *mut _cef_run_file_dialog_callback_t, 1703 | ), 1704 | >, 1705 | pub start_download: 1706 | ::std::option::Option, 1707 | pub download_image: ::std::option::Option< 1708 | unsafe extern "C" fn( 1709 | self_: *mut _cef_browser_host_t, 1710 | image_url: *const cef_string_t, 1711 | is_favicon: ::std::os::raw::c_int, 1712 | max_image_size: uint32, 1713 | bypass_cache: ::std::os::raw::c_int, 1714 | callback: *mut _cef_download_image_callback_t, 1715 | ), 1716 | >, 1717 | pub print: ::std::option::Option, 1718 | pub print_to_pdf: ::std::option::Option< 1719 | unsafe extern "C" fn( 1720 | self_: *mut _cef_browser_host_t, 1721 | path: *const cef_string_t, 1722 | settings: *const _cef_pdf_print_settings_t, 1723 | callback: *mut _cef_pdf_print_callback_t, 1724 | ), 1725 | >, 1726 | pub find: ::std::option::Option< 1727 | unsafe extern "C" fn( 1728 | self_: *mut _cef_browser_host_t, 1729 | identifier: ::std::os::raw::c_int, 1730 | searchText: *const cef_string_t, 1731 | forward: ::std::os::raw::c_int, 1732 | matchCase: ::std::os::raw::c_int, 1733 | findNext: ::std::os::raw::c_int, 1734 | ), 1735 | >, 1736 | pub stop_finding: ::std::option::Option< 1737 | unsafe extern "C" fn(self_: *mut _cef_browser_host_t, clearSelection: ::std::os::raw::c_int), 1738 | >, 1739 | pub show_dev_tools: ::std::option::Option< 1740 | unsafe extern "C" fn( 1741 | self_: *mut _cef_browser_host_t, 1742 | windowInfo: *const _cef_window_info_t, 1743 | client: *mut _cef_client_t, 1744 | settings: *const _cef_browser_settings_t, 1745 | inspect_element_at: *const cef_point_t, 1746 | ), 1747 | >, 1748 | pub close_dev_tools: ::std::option::Option, 1749 | pub has_dev_tools: 1750 | ::std::option::Option ::std::os::raw::c_int>, 1751 | pub get_navigation_entries: ::std::option::Option< 1752 | unsafe extern "C" fn( 1753 | self_: *mut _cef_browser_host_t, 1754 | visitor: *mut _cef_navigation_entry_visitor_t, 1755 | current_only: ::std::os::raw::c_int, 1756 | ), 1757 | >, 1758 | pub set_mouse_cursor_change_disabled: 1759 | ::std::option::Option, 1760 | pub is_mouse_cursor_change_disabled: 1761 | ::std::option::Option ::std::os::raw::c_int>, 1762 | pub replace_misspelling: 1763 | ::std::option::Option, 1764 | pub add_word_to_dictionary: 1765 | ::std::option::Option, 1766 | pub is_window_rendering_disabled: 1767 | ::std::option::Option ::std::os::raw::c_int>, 1768 | pub was_resized: ::std::option::Option, 1769 | pub was_hidden: 1770 | ::std::option::Option, 1771 | pub notify_screen_info_changed: ::std::option::Option, 1772 | pub invalidate: 1773 | ::std::option::Option, 1774 | pub send_external_begin_frame: ::std::option::Option, 1775 | pub send_key_event: 1776 | ::std::option::Option, 1777 | pub send_mouse_click_event: ::std::option::Option< 1778 | unsafe extern "C" fn( 1779 | self_: *mut _cef_browser_host_t, 1780 | event: *const _cef_mouse_event_t, 1781 | type_: cef_mouse_button_type_t, 1782 | mouseUp: ::std::os::raw::c_int, 1783 | clickCount: ::std::os::raw::c_int, 1784 | ), 1785 | >, 1786 | pub send_mouse_move_event: ::std::option::Option< 1787 | unsafe extern "C" fn( 1788 | self_: *mut _cef_browser_host_t, 1789 | event: *const _cef_mouse_event_t, 1790 | mouseLeave: ::std::os::raw::c_int, 1791 | ), 1792 | >, 1793 | pub send_mouse_wheel_event: ::std::option::Option< 1794 | unsafe extern "C" fn( 1795 | self_: *mut _cef_browser_host_t, 1796 | event: *const _cef_mouse_event_t, 1797 | deltaX: ::std::os::raw::c_int, 1798 | deltaY: ::std::os::raw::c_int, 1799 | ), 1800 | >, 1801 | pub send_touch_event: 1802 | ::std::option::Option, 1803 | pub send_focus_event: 1804 | ::std::option::Option, 1805 | pub send_capture_lost_event: ::std::option::Option, 1806 | pub notify_move_or_resize_started: ::std::option::Option, 1807 | pub get_windowless_frame_rate: 1808 | ::std::option::Option ::std::os::raw::c_int>, 1809 | pub set_windowless_frame_rate: 1810 | ::std::option::Option, 1811 | pub ime_set_composition: ::std::option::Option< 1812 | unsafe extern "C" fn( 1813 | self_: *mut _cef_browser_host_t, 1814 | text: *const cef_string_t, 1815 | underlinesCount: size_t, 1816 | underlines: *const cef_composition_underline_t, 1817 | replacement_range: *const cef_range_t, 1818 | selection_range: *const cef_range_t, 1819 | ), 1820 | >, 1821 | pub ime_commit_text: ::std::option::Option< 1822 | unsafe extern "C" fn( 1823 | self_: *mut _cef_browser_host_t, 1824 | text: *const cef_string_t, 1825 | replacement_range: *const cef_range_t, 1826 | relative_cursor_pos: ::std::os::raw::c_int, 1827 | ), 1828 | >, 1829 | pub ime_finish_composing_text: ::std::option::Option< 1830 | unsafe extern "C" fn(self_: *mut _cef_browser_host_t, keep_selection: ::std::os::raw::c_int), 1831 | >, 1832 | pub ime_cancel_composition: ::std::option::Option, 1833 | pub drag_target_drag_enter: ::std::option::Option< 1834 | unsafe extern "C" fn( 1835 | self_: *mut _cef_browser_host_t, 1836 | drag_data: *mut _cef_drag_data_t, 1837 | event: *const _cef_mouse_event_t, 1838 | allowed_ops: cef_drag_operations_mask_t, 1839 | ), 1840 | >, 1841 | pub drag_target_drag_over: ::std::option::Option< 1842 | unsafe extern "C" fn( 1843 | self_: *mut _cef_browser_host_t, 1844 | event: *const _cef_mouse_event_t, 1845 | allowed_ops: cef_drag_operations_mask_t, 1846 | ), 1847 | >, 1848 | pub drag_target_drag_leave: ::std::option::Option, 1849 | pub drag_target_drop: 1850 | ::std::option::Option, 1851 | pub drag_source_ended_at: ::std::option::Option< 1852 | unsafe extern "C" fn( 1853 | self_: *mut _cef_browser_host_t, 1854 | x: ::std::os::raw::c_int, 1855 | y: ::std::os::raw::c_int, 1856 | op: cef_drag_operations_mask_t, 1857 | ), 1858 | >, 1859 | pub drag_source_system_drag_ended: ::std::option::Option, 1860 | pub get_visible_navigation_entry: 1861 | ::std::option::Option *mut _cef_navigation_entry_t>, 1862 | pub set_accessibility_state: 1863 | ::std::option::Option, 1864 | pub set_auto_resize_enabled: ::std::option::Option< 1865 | unsafe extern "C" fn( 1866 | self_: *mut _cef_browser_host_t, 1867 | enabled: ::std::os::raw::c_int, 1868 | min_size: *const cef_size_t, 1869 | max_size: *const cef_size_t, 1870 | ), 1871 | >, 1872 | pub get_extension: 1873 | ::std::option::Option *mut _cef_extension_t>, 1874 | pub is_background_host: 1875 | ::std::option::Option ::std::os::raw::c_int>, 1876 | pub set_audio_muted: 1877 | ::std::option::Option, 1878 | pub is_audio_muted: 1879 | ::std::option::Option ::std::os::raw::c_int>, 1880 | } 1881 | #[repr(C)] 1882 | pub struct _cef_get_extension_resource_callback_t { 1883 | pub base: cef_base_ref_counted_t, 1884 | pub cont: ::std::option::Option< 1885 | unsafe extern "C" fn(self_: *mut _cef_get_extension_resource_callback_t, stream: *mut _cef_stream_reader_t), 1886 | >, 1887 | pub cancel: ::std::option::Option, 1888 | } 1889 | #[repr(C)] 1890 | pub struct _cef_extension_handler_t { 1891 | pub base: cef_base_ref_counted_t, 1892 | pub on_extension_load_failed: 1893 | ::std::option::Option, 1894 | pub on_extension_loaded: ::std::option::Option< 1895 | unsafe extern "C" fn(self_: *mut _cef_extension_handler_t, extension: *mut _cef_extension_t), 1896 | >, 1897 | pub on_extension_unloaded: ::std::option::Option< 1898 | unsafe extern "C" fn(self_: *mut _cef_extension_handler_t, extension: *mut _cef_extension_t), 1899 | >, 1900 | pub on_before_background_browser: ::std::option::Option< 1901 | unsafe extern "C" fn( 1902 | self_: *mut _cef_extension_handler_t, 1903 | extension: *mut _cef_extension_t, 1904 | url: *const cef_string_t, 1905 | client: *mut *mut _cef_client_t, 1906 | settings: *mut _cef_browser_settings_t, 1907 | ) -> ::std::os::raw::c_int, 1908 | >, 1909 | pub on_before_browser: ::std::option::Option< 1910 | unsafe extern "C" fn( 1911 | self_: *mut _cef_extension_handler_t, 1912 | extension: *mut _cef_extension_t, 1913 | browser: *mut _cef_browser_t, 1914 | active_browser: *mut _cef_browser_t, 1915 | index: ::std::os::raw::c_int, 1916 | url: *const cef_string_t, 1917 | active: ::std::os::raw::c_int, 1918 | windowInfo: *mut _cef_window_info_t, 1919 | client: *mut *mut _cef_client_t, 1920 | settings: *mut _cef_browser_settings_t, 1921 | ) -> ::std::os::raw::c_int, 1922 | >, 1923 | pub get_active_browser: ::std::option::Option< 1924 | unsafe extern "C" fn( 1925 | self_: *mut _cef_extension_handler_t, 1926 | extension: *mut _cef_extension_t, 1927 | browser: *mut _cef_browser_t, 1928 | include_incognito: ::std::os::raw::c_int, 1929 | ) -> *mut _cef_browser_t, 1930 | >, 1931 | pub can_access_browser: ::std::option::Option< 1932 | unsafe extern "C" fn( 1933 | self_: *mut _cef_extension_handler_t, 1934 | extension: *mut _cef_extension_t, 1935 | browser: *mut _cef_browser_t, 1936 | include_incognito: ::std::os::raw::c_int, 1937 | target_browser: *mut _cef_browser_t, 1938 | ) -> ::std::os::raw::c_int, 1939 | >, 1940 | pub get_extension_resource: ::std::option::Option< 1941 | unsafe extern "C" fn( 1942 | self_: *mut _cef_extension_handler_t, 1943 | extension: *mut _cef_extension_t, 1944 | browser: *mut _cef_browser_t, 1945 | file: *const cef_string_t, 1946 | callback: *mut _cef_get_extension_resource_callback_t, 1947 | ) -> ::std::os::raw::c_int, 1948 | >, 1949 | } 1950 | #[repr(C)] 1951 | pub struct _cef_request_context_handler_t { 1952 | _unused: [u8; 0], 1953 | } 1954 | #[repr(C)] 1955 | pub struct _cef_scheme_handler_factory_t { 1956 | _unused: [u8; 0], 1957 | } 1958 | #[repr(C)] 1959 | pub struct _cef_resolve_callback_t { 1960 | pub base: cef_base_ref_counted_t, 1961 | pub on_resolve_completed: ::std::option::Option< 1962 | unsafe extern "C" fn( 1963 | self_: *mut _cef_resolve_callback_t, 1964 | result: cef_errorcode_t, 1965 | resolved_ips: cef_string_list_t, 1966 | ), 1967 | >, 1968 | } 1969 | #[repr(C)] 1970 | pub struct _cef_request_context_t { 1971 | pub base: cef_base_ref_counted_t, 1972 | pub is_same: ::std::option::Option< 1973 | unsafe extern "C" fn( 1974 | self_: *mut _cef_request_context_t, 1975 | other: *mut _cef_request_context_t, 1976 | ) -> ::std::os::raw::c_int, 1977 | >, 1978 | pub is_sharing_with: ::std::option::Option< 1979 | unsafe extern "C" fn( 1980 | self_: *mut _cef_request_context_t, 1981 | other: *mut _cef_request_context_t, 1982 | ) -> ::std::os::raw::c_int, 1983 | >, 1984 | pub is_global: 1985 | ::std::option::Option ::std::os::raw::c_int>, 1986 | pub get_handler: ::std::option::Option< 1987 | unsafe extern "C" fn(self_: *mut _cef_request_context_t) -> *mut _cef_request_context_handler_t, 1988 | >, 1989 | pub get_cache_path: 1990 | ::std::option::Option cef_string_userfree_t>, 1991 | pub get_cookie_manager: ::std::option::Option< 1992 | unsafe extern "C" fn( 1993 | self_: *mut _cef_request_context_t, 1994 | callback: *mut _cef_completion_callback_t, 1995 | ) -> *mut _cef_cookie_manager_t, 1996 | >, 1997 | pub register_scheme_handler_factory: ::std::option::Option< 1998 | unsafe extern "C" fn( 1999 | self_: *mut _cef_request_context_t, 2000 | scheme_name: *const cef_string_t, 2001 | domain_name: *const cef_string_t, 2002 | factory: *mut _cef_scheme_handler_factory_t, 2003 | ) -> ::std::os::raw::c_int, 2004 | >, 2005 | pub clear_scheme_handler_factories: 2006 | ::std::option::Option ::std::os::raw::c_int>, 2007 | pub purge_plugin_list_cache: ::std::option::Option< 2008 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, reload_pages: ::std::os::raw::c_int), 2009 | >, 2010 | pub has_preference: ::std::option::Option< 2011 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, name: *const cef_string_t) -> ::std::os::raw::c_int, 2012 | >, 2013 | pub get_preference: ::std::option::Option< 2014 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, name: *const cef_string_t) -> *mut _cef_value_t, 2015 | >, 2016 | pub get_all_preferences: ::std::option::Option< 2017 | unsafe extern "C" fn( 2018 | self_: *mut _cef_request_context_t, 2019 | include_defaults: ::std::os::raw::c_int, 2020 | ) -> *mut _cef_dictionary_value_t, 2021 | >, 2022 | pub can_set_preference: ::std::option::Option< 2023 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, name: *const cef_string_t) -> ::std::os::raw::c_int, 2024 | >, 2025 | pub set_preference: ::std::option::Option< 2026 | unsafe extern "C" fn( 2027 | self_: *mut _cef_request_context_t, 2028 | name: *const cef_string_t, 2029 | value: *mut _cef_value_t, 2030 | error: *mut cef_string_t, 2031 | ) -> ::std::os::raw::c_int, 2032 | >, 2033 | pub clear_certificate_exceptions: ::std::option::Option< 2034 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, callback: *mut _cef_completion_callback_t), 2035 | >, 2036 | pub clear_http_auth_credentials: ::std::option::Option< 2037 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, callback: *mut _cef_completion_callback_t), 2038 | >, 2039 | pub close_all_connections: ::std::option::Option< 2040 | unsafe extern "C" fn(self_: *mut _cef_request_context_t, callback: *mut _cef_completion_callback_t), 2041 | >, 2042 | pub resolve_host: ::std::option::Option< 2043 | unsafe extern "C" fn( 2044 | self_: *mut _cef_request_context_t, 2045 | origin: *const cef_string_t, 2046 | callback: *mut _cef_resolve_callback_t, 2047 | ), 2048 | >, 2049 | pub load_extension: ::std::option::Option< 2050 | unsafe extern "C" fn( 2051 | self_: *mut _cef_request_context_t, 2052 | root_directory: *const cef_string_t, 2053 | manifest: *mut _cef_dictionary_value_t, 2054 | handler: *mut _cef_extension_handler_t, 2055 | ), 2056 | >, 2057 | pub did_load_extension: ::std::option::Option< 2058 | unsafe extern "C" fn( 2059 | self_: *mut _cef_request_context_t, 2060 | extension_id: *const cef_string_t, 2061 | ) -> ::std::os::raw::c_int, 2062 | >, 2063 | pub has_extension: ::std::option::Option< 2064 | unsafe extern "C" fn( 2065 | self_: *mut _cef_request_context_t, 2066 | extension_id: *const cef_string_t, 2067 | ) -> ::std::os::raw::c_int, 2068 | >, 2069 | pub get_extensions: ::std::option::Option< 2070 | unsafe extern "C" fn( 2071 | self_: *mut _cef_request_context_t, 2072 | extension_ids: cef_string_list_t, 2073 | ) -> ::std::os::raw::c_int, 2074 | >, 2075 | pub get_extension: ::std::option::Option< 2076 | unsafe extern "C" fn( 2077 | self_: *mut _cef_request_context_t, 2078 | extension_id: *const cef_string_t, 2079 | ) -> *mut _cef_extension_t, 2080 | >, 2081 | } 2082 | #[repr(C)] 2083 | pub struct _cef_response_t { 2084 | pub base: cef_base_ref_counted_t, 2085 | pub is_read_only: ::std::option::Option ::std::os::raw::c_int>, 2086 | pub get_error: ::std::option::Option cef_errorcode_t>, 2087 | pub set_error: ::std::option::Option, 2088 | pub get_status: ::std::option::Option ::std::os::raw::c_int>, 2089 | pub set_status: 2090 | ::std::option::Option, 2091 | pub get_status_text: 2092 | ::std::option::Option cef_string_userfree_t>, 2093 | pub set_status_text: 2094 | ::std::option::Option, 2095 | pub get_mime_type: 2096 | ::std::option::Option cef_string_userfree_t>, 2097 | pub set_mime_type: 2098 | ::std::option::Option, 2099 | pub get_charset: ::std::option::Option cef_string_userfree_t>, 2100 | pub set_charset: 2101 | ::std::option::Option, 2102 | pub get_header_by_name: ::std::option::Option< 2103 | unsafe extern "C" fn(self_: *mut _cef_response_t, name: *const cef_string_t) -> cef_string_userfree_t, 2104 | >, 2105 | pub set_header_by_name: ::std::option::Option< 2106 | unsafe extern "C" fn( 2107 | self_: *mut _cef_response_t, 2108 | name: *const cef_string_t, 2109 | value: *const cef_string_t, 2110 | overwrite: ::std::os::raw::c_int, 2111 | ), 2112 | >, 2113 | pub get_header_map: 2114 | ::std::option::Option, 2115 | pub set_header_map: 2116 | ::std::option::Option, 2117 | pub get_url: ::std::option::Option cef_string_userfree_t>, 2118 | pub set_url: ::std::option::Option, 2119 | } 2120 | #[repr(C)] 2121 | pub struct _cef_urlrequest_t { 2122 | pub base: cef_base_ref_counted_t, 2123 | pub get_request: ::std::option::Option *mut _cef_request_t>, 2124 | pub get_client: 2125 | ::std::option::Option *mut _cef_urlrequest_client_t>, 2126 | pub get_request_status: 2127 | ::std::option::Option cef_urlrequest_status_t>, 2128 | pub get_request_error: 2129 | ::std::option::Option cef_errorcode_t>, 2130 | pub get_response: 2131 | ::std::option::Option *mut _cef_response_t>, 2132 | pub response_was_cached: 2133 | ::std::option::Option ::std::os::raw::c_int>, 2134 | pub cancel: ::std::option::Option, 2135 | } 2136 | pub type cef_urlrequest_t = _cef_urlrequest_t; 2137 | extern "C" { 2138 | pub fn cef_urlrequest_create( 2139 | request: *mut _cef_request_t, 2140 | client: *mut _cef_urlrequest_client_t, 2141 | request_context: *mut _cef_request_context_t, 2142 | ) -> *mut cef_urlrequest_t; 2143 | } 2144 | #[repr(C)] 2145 | pub struct _cef_urlrequest_client_t { 2146 | pub base: cef_base_ref_counted_t, 2147 | pub on_request_complete: ::std::option::Option< 2148 | unsafe extern "C" fn(self_: *mut _cef_urlrequest_client_t, request: *mut _cef_urlrequest_t), 2149 | >, 2150 | pub on_upload_progress: ::std::option::Option< 2151 | unsafe extern "C" fn( 2152 | self_: *mut _cef_urlrequest_client_t, 2153 | request: *mut _cef_urlrequest_t, 2154 | current: int64, 2155 | total: int64, 2156 | ), 2157 | >, 2158 | pub on_download_progress: ::std::option::Option< 2159 | unsafe extern "C" fn( 2160 | self_: *mut _cef_urlrequest_client_t, 2161 | request: *mut _cef_urlrequest_t, 2162 | current: int64, 2163 | total: int64, 2164 | ), 2165 | >, 2166 | pub on_download_data: ::std::option::Option< 2167 | unsafe extern "C" fn( 2168 | self_: *mut _cef_urlrequest_client_t, 2169 | request: *mut _cef_urlrequest_t, 2170 | data: *const ::std::os::raw::c_void, 2171 | data_length: size_t, 2172 | ), 2173 | >, 2174 | pub get_auth_credentials: ::std::option::Option< 2175 | unsafe extern "C" fn( 2176 | self_: *mut _cef_urlrequest_client_t, 2177 | isProxy: ::std::os::raw::c_int, 2178 | host: *const cef_string_t, 2179 | port: ::std::os::raw::c_int, 2180 | realm: *const cef_string_t, 2181 | scheme: *const cef_string_t, 2182 | callback: *mut _cef_auth_callback_t, 2183 | ) -> ::std::os::raw::c_int, 2184 | >, 2185 | } 2186 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod cef; 2 | 3 | use cef::{ 4 | _cef_request_context_t, _cef_request_t, _cef_urlrequest_client_t, cef_string_userfree_utf16_t, cef_urlrequest_t, 5 | }; 6 | use lazy_static::lazy_static; 7 | use libc::{addrinfo, c_char, dlsym, EAI_FAIL, RTLD_NEXT}; 8 | use regex::RegexSet; 9 | use serde::Deserialize; 10 | use std::{env, ffi::CStr, fs::read_to_string, mem, path::PathBuf, ptr::null, slice::from_raw_parts, string::String}; 11 | 12 | macro_rules! hook { 13 | ($function_name:ident($($parameter_name:ident: $parameter_type:ty),*) -> $return_type:ty => $new_function_name:ident $body:block) => { 14 | lazy_static! { 15 | static ref $new_function_name: fn($($parameter_type),*) -> $return_type = unsafe { 16 | let function_name = CStr::from_bytes_with_nul(concat!(stringify!($function_name), "\0").as_bytes()).unwrap(); 17 | let function_pointer = dlsym(RTLD_NEXT, function_name.as_ptr()); 18 | if function_pointer.is_null() { 19 | panic!("[*] Error: Unable to find function \"{}\"", stringify!($function_name)); 20 | } 21 | mem::transmute(function_pointer) 22 | }; 23 | } 24 | 25 | #[no_mangle] 26 | pub unsafe extern "C" fn $function_name($($parameter_name: $parameter_type),*) -> $return_type { 27 | $body 28 | } 29 | } 30 | } 31 | 32 | #[derive(Deserialize)] 33 | struct Config { 34 | #[serde(with = "serde_regex")] 35 | allowlist: RegexSet, 36 | #[serde(with = "serde_regex")] 37 | denylist: RegexSet, 38 | } 39 | 40 | lazy_static! { 41 | static ref CONFIG: Config = { 42 | let config_paths = vec![ 43 | PathBuf::from("config.toml"), 44 | match env::var("XDG_CONFIG_HOME") { 45 | Ok(xdg_config_home) => PathBuf::from(xdg_config_home), 46 | #[allow(deprecated)] // std::env::home_dir() is only broken on Windows 47 | Err(_) => PathBuf::from(env::home_dir().unwrap()).join(".config") 48 | }.join("spotify-adblock/config.toml"), 49 | PathBuf::from("/etc/spotify-adblock/config.toml"), 50 | ]; 51 | 52 | if let Some(path) = config_paths.into_iter().find(|path| path.exists()) { 53 | println!("[*] Config file: {}", path.to_str().unwrap()); 54 | match read_to_string(path) { 55 | Ok(config_string) => match toml::from_str(&config_string) { 56 | Ok(config) => { 57 | return config; 58 | } 59 | Err(error) => { 60 | println!("[*] Error: Parse config file ({})", error); 61 | } 62 | }, 63 | Err(error) => { 64 | println!("[*] Error: Read config file ({})", error); 65 | } 66 | } 67 | } else { 68 | println!("[*] Error: No config file"); 69 | }; 70 | Config { 71 | allowlist: RegexSet::empty(), 72 | denylist: RegexSet::empty(), 73 | } 74 | }; 75 | } 76 | 77 | hook! { 78 | getaddrinfo(node: *const c_char, service: *const c_char, hints: *const addrinfo, res: *const *const addrinfo) -> i32 => REAL_GETADDRINFO { 79 | let domain = CStr::from_ptr(node).to_str().unwrap(); 80 | 81 | if CONFIG.allowlist.is_match(&domain) { 82 | println!("[+] getaddrinfo:\t\t {}", domain); 83 | REAL_GETADDRINFO(node, service, hints, res) 84 | } else { 85 | println!("[-] getaddrinfo:\t\t {}", domain); 86 | EAI_FAIL 87 | } 88 | } 89 | } 90 | 91 | hook! { 92 | cef_urlrequest_create(request: *mut _cef_request_t, client: *const _cef_urlrequest_client_t, request_context: *const _cef_request_context_t) -> *const cef_urlrequest_t => REAL_CEF_URLREQUEST_CREATE { 93 | let url_cef = (*request).get_url.unwrap()(request); 94 | let url_utf16 = from_raw_parts((*url_cef).str_, (*url_cef).length as usize); 95 | let url = String::from_utf16(url_utf16).unwrap(); 96 | cef_string_userfree_utf16_free(url_cef); 97 | 98 | if CONFIG.denylist.is_match(&url) { 99 | println!("[-] cef_urlrequest_create:\t {}", url); 100 | null() 101 | } else { 102 | println!("[+] cef_urlrequest_create:\t {}", url); 103 | REAL_CEF_URLREQUEST_CREATE(request, client, request_context) 104 | } 105 | } 106 | } 107 | 108 | hook! { 109 | cef_string_userfree_utf16_free(_str: cef_string_userfree_utf16_t) -> () => REAL_CEF_STRING_USERFREE_UTF16_FREE { 110 | REAL_CEF_STRING_USERFREE_UTF16_FREE(_str); 111 | } 112 | } 113 | --------------------------------------------------------------------------------