├── .gitattributes ├── .github └── workflows │ └── codacy-analysis.yml ├── .gitignore ├── LICENSE.md ├── README.md ├── SECURITY.md ├── build └── never-lose.crx ├── chrome ├── images │ ├── icon-128.png │ ├── icon-16.png │ ├── icon-32.png │ └── icon-64.png ├── lib │ └── lodash.js ├── list │ ├── advertise.js │ ├── porn.js │ └── well_known.js ├── manifest.json ├── options │ ├── options.css │ ├── options.html │ └── options.js └── wayback.js ├── package.json └── utils └── version.js /.gitattributes: -------------------------------------------------------------------------------- 1 | *.crx filter=lfs diff=lfs merge=lfs -text 2 | chrome/lib/* filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.github/workflows/codacy-analysis.yml: -------------------------------------------------------------------------------- 1 | # This workflow checks out code, performs a Codacy security scan 2 | # and integrates the results with the 3 | # GitHub Advanced Security code scanning feature. For more information on 4 | # the Codacy security scan action usage and parameters, see 5 | # https://github.com/codacy/codacy-analysis-cli-action. 6 | # For more information on Codacy Analysis CLI in general, see 7 | # https://github.com/codacy/codacy-analysis-cli. 8 | 9 | name: Codacy Security Scan 10 | 11 | on: 12 | push: 13 | branches: [ master ] 14 | pull_request: 15 | branches: [ master ] 16 | 17 | jobs: 18 | codacy-security-scan: 19 | name: Codacy Security Scan 20 | runs-on: ubuntu-latest 21 | steps: 22 | # Checkout the repository to the GitHub Actions runner 23 | - name: Checkout code 24 | uses: actions/checkout@v2 25 | 26 | # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis 27 | - name: Run Codacy Analysis CLI 28 | uses: codacy/codacy-analysis-cli-action@1.1.0 29 | with: 30 | # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository 31 | # You can also omit the token and run the tools that support default configurations 32 | project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} 33 | verbose: true 34 | output: results.sarif 35 | format: sarif 36 | # Adjust severity of non-security issues 37 | gh-code-scanning-compat: true 38 | # Force 0 exit code to allow SARIF file generation 39 | # This will handover control about PR rejection to the GitHub side 40 | max-allowed-issues: 2147483647 41 | 42 | # Upload the SARIF file generated in the previous step 43 | - name: Upload SARIF results file 44 | uses: github/codeql-action/upload-sarif@v1 45 | with: 46 | sarif_file: results.sarif 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | chrome/bower_components 3 | node_modules 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The GNU General Public License, Version 3, 29 June 2007 (GPLv3) 2 | =============================================================== 3 | 4 | > Copyright © 2007 5 | > Free Software Foundation, Inc. 6 | > <> 7 | 8 | Everyone is permitted to copy and distribute verbatim copies of this license 9 | document, but changing it is not allowed. 10 | 11 | 12 | Preamble 13 | -------- 14 | 15 | The GNU General Public License is a free, copyleft license for software and 16 | other kinds of works. 17 | 18 | The licenses for most software and other practical works are designed to take 19 | away your freedom to share and change the works. By contrast, the GNU General 20 | Public License is intended to guarantee your freedom to share and change all 21 | versions of a program--to make sure it remains free software for all its users. 22 | We, the Free Software Foundation, use the GNU General Public License for most of 23 | our software; it applies also to any other work released this way by its 24 | authors. You can apply it to your programs, too. 25 | 26 | When we speak of free software, we are referring to freedom, not price. Our 27 | General Public Licenses are designed to make sure that you have the freedom to 28 | distribute copies of free software (and charge for them if you wish), that you 29 | receive source code or can get it if you want it, that you can change the 30 | software or use pieces of it in new free programs, and that you know you can do 31 | these things. 32 | 33 | To protect your rights, we need to prevent others from denying you these rights 34 | or asking you to surrender the rights. Therefore, you have certain 35 | responsibilities if you distribute copies of the software, or if you modify it: 36 | responsibilities to respect the freedom of others. 37 | 38 | For example, if you distribute copies of such a program, whether gratis or for a 39 | fee, you must pass on to the recipients the same freedoms that you received. You 40 | must make sure that they, too, receive or can get the source code. And you must 41 | show them these terms so they know their rights. 42 | 43 | Developers that use the GNU GPL protect your rights with two steps: (1) assert 44 | copyright on the software, and (2) offer you this License giving you legal 45 | permission to copy, distribute and/or modify it. 46 | 47 | For the developers' and authors' protection, the GPL clearly explains that there 48 | is no warranty for this free software. For both users' and authors' sake, the 49 | GPL requires that modified versions be marked as changed, so that their problems 50 | will not be attributed erroneously to authors of previous versions. 51 | 52 | Some devices are designed to deny users access to install or run modified 53 | versions of the software inside them, although the manufacturer can do so. This 54 | is fundamentally incompatible with the aim of protecting users' freedom to 55 | change the software. The systematic pattern of such abuse occurs in the area of 56 | products for individuals to use, which is precisely where it is most 57 | unacceptable. Therefore, we have designed this version of the GPL to prohibit 58 | the practice for those products. If such problems arise substantially in other 59 | domains, we stand ready to extend this provision to those domains in future 60 | versions of the GPL, as needed to protect the freedom of users. 61 | 62 | Finally, every program is threatened constantly by software patents. States 63 | should not allow patents to restrict development and use of software on 64 | general-purpose computers, but in those that do, we wish to avoid the special 65 | danger that patents applied to a free program could make it effectively 66 | proprietary. To prevent this, the GPL assures that patents cannot be used to 67 | render the program non-free. 68 | 69 | The precise terms and conditions for copying, distribution and modification 70 | follow. 71 | 72 | 73 | TERMS AND CONDITIONS 74 | -------------------- 75 | 76 | 77 | ### 0. Definitions. 78 | 79 | "This License refers to version 3 of the GNU General Public License. 80 | 81 | "Copyright" also means copyright-like laws that apply to other kinds of works, 82 | such as semiconductor masks. 83 | 84 | "The Program" refers to any copyrightable work licensed under this License. Each 85 | licensee is addressed as "you". "Licensees" and "recipients" may be individuals 86 | or organizations. 87 | 88 | To "modify" a work means to copy from or adapt all or part of the work in a 89 | fashion requiring copyright permission, other than the making of an exact copy. 90 | The resulting work is called a "modified version" of the earlier work or a work 91 | "based on" the earlier work. 92 | 93 | A "covered work" means either the unmodified Program or a work based on the 94 | Program. 95 | 96 | To "propagate" a work means to do anything with it that, without permission, 97 | would make you directly or secondarily liable for infringement under applicable 98 | copyright law, except executing it on a computer or modifying a private copy. 99 | Propagation includes copying, distribution (with or without modification), 100 | making available to the public, and in some countries other activities as well. 101 | 102 | To "convey" a work means any kind of propagation that enables other parties to 103 | make or receive copies. Mere interaction with a user through a computer network, 104 | with no transfer of a copy, is not conveying. 105 | 106 | An interactive user interface displays "Appropriate Legal Notices" to the extent 107 | that it includes a convenient and prominently visible feature that (1) displays 108 | an appropriate copyright notice, and (2) tells the user that there is no 109 | warranty for the work (except to the extent that warranties are provided), that 110 | licensees may convey the work under this License, and how to view a copy of this 111 | License. If the interface presents a list of user commands or options, such as a 112 | menu, a prominent item in the list meets this criterion. 113 | 114 | 115 | ### 1. Source Code. 116 | 117 | The "source code" for a work means the preferred form of the work for making 118 | modifications to it. "Object code" means any non-source form of a work. 119 | 120 | A "Standard Interface" means an interface that either is an official standard 121 | defined by a recognized standards body, or, in the case of interfaces specified 122 | for a particular programming language, one that is widely used among developers 123 | working in that language. 124 | 125 | The "System Libraries" of an executable work include anything, other than the 126 | work as a whole, that (a) is included in the normal form of packaging a Major 127 | Component, but which is not part of that Major Component, and (b) serves only to 128 | enable use of the work with that Major Component, or to implement a Standard 129 | Interface for which an implementation is available to the public in source code 130 | form. A "Major Component", in this context, means a major essential component 131 | (kernel, window system, and so on) of the specific operating system (if any) on 132 | which the executable work runs, or a compiler used to produce the work, or an 133 | object code interpreter used to run it. 134 | 135 | The "Corresponding Source" for a work in object code form means all the source 136 | code needed to generate, install, and (for an executable work) run the object 137 | code and to modify the work, including scripts to control those activities. 138 | However, it does not include the work's System Libraries, or general-purpose 139 | tools or generally available free programs which are used unmodified in 140 | performing those activities but which are not part of the work. For example, 141 | Corresponding Source includes interface definition files associated with source 142 | files for the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, such as by 144 | intimate data communication or control flow between those subprograms and other 145 | parts of the work. 146 | 147 | The Corresponding Source need not include anything that users can regenerate 148 | automatically from other parts of the Corresponding Source. 149 | 150 | The Corresponding Source for a work in source code form is that same work. 151 | 152 | 153 | ### 2. Basic Permissions. 154 | 155 | All rights granted under this License are granted for the term of copyright on 156 | the Program, and are irrevocable provided the stated conditions are met. This 157 | License explicitly affirms your unlimited permission to run the unmodified 158 | Program. The output from running a covered work is covered by this License only 159 | if the output, given its content, constitutes a covered work. This License 160 | acknowledges your rights of fair use or other equivalent, as provided by 161 | copyright law. 162 | 163 | You may make, run and propagate covered works that you do not convey, without 164 | conditions so long as your license otherwise remains in force. You may convey 165 | covered works to others for the sole purpose of having them make modifications 166 | exclusively for you, or provide you with facilities for running those works, 167 | provided that you comply with the terms of this License in conveying all 168 | material for which you do not control copyright. Those thus making or running 169 | the covered works for you must do so exclusively on your behalf, under your 170 | direction and control, on terms that prohibit them from making any copies of 171 | your copyrighted material outside their relationship with you. 172 | 173 | Conveying under any other circumstances is permitted solely under the conditions 174 | stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 175 | 176 | 177 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 178 | 179 | No covered work shall be deemed part of an effective technological measure under 180 | any applicable law fulfilling obligations under article 11 of the WIPO copyright 181 | treaty adopted on 20 December 1996, or similar laws prohibiting or restricting 182 | circumvention of such measures. 183 | 184 | When you convey a covered work, you waive any legal power to forbid 185 | circumvention of technological measures to the extent such circumvention is 186 | effected by exercising rights under this License with respect to the covered 187 | work, and you disclaim any intention to limit operation or modification of the 188 | work as a means of enforcing, against the work's users, your or third parties' 189 | legal rights to forbid circumvention of technological measures. 190 | 191 | 192 | ### 4. Conveying Verbatim Copies. 193 | 194 | You may convey verbatim copies of the Program's source code as you receive it, 195 | in any medium, provided that you conspicuously and appropriately publish on each 196 | copy an appropriate copyright notice; keep intact all notices stating that this 197 | License and any non-permissive terms added in accord with section 7 apply to the 198 | code; keep intact all notices of the absence of any warranty; and give all 199 | recipients a copy of this License along with the Program. 200 | 201 | You may charge any price or no price for each copy that you convey, and you may 202 | offer support or warranty protection for a fee. 203 | 204 | 205 | ### 5. Conveying Modified Source Versions. 206 | 207 | You may convey a work based on the Program, or the modifications to produce it 208 | from the Program, in the form of source code under the terms of section 4, 209 | provided that you also meet all of these conditions: 210 | 211 | * **a)** The work must carry prominent notices stating that you modified it, 212 | and giving a relevant date. 213 | 214 | * **b)** The work must carry prominent notices stating that it is released 215 | under this License and any conditions added under section 7. This 216 | requirement modifies the requirement in section 4 to "keep intact all 217 | notices". 218 | 219 | * **c)** You must license the entire work, as a whole, under this License to 220 | anyone who comes into possession of a copy. This License will therefore 221 | apply, along with any applicable section 7 additional terms, to the whole of 222 | the work, and all its parts, regardless of how they are packaged. This 223 | License gives no permission to license the work in any other way, but it 224 | does not invalidate such permission if you have separately received it. 225 | 226 | * **d)** If the work has interactive user interfaces, each must display 227 | Appropriate Legal Notices; however, if the Program has interactive 228 | interfaces that do not display Appropriate Legal Notices, your work need not 229 | make them do so. 230 | 231 | A compilation of a covered work with other separate and independent works, 232 | which are not by their nature extensions of the covered work, and which are 233 | not combined with it such as to form a larger program, in or on a volume of 234 | a storage or distribution medium, is called an "aggregate" if the 235 | compilation and its resulting copyright are not used to limit the access or 236 | legal rights of the compilation's users beyond what the individual works 237 | permit. Inclusion of a covered work in an aggregate does not cause this 238 | License to apply to the other parts of the aggregate. 239 | 240 | 241 | ### 6. Conveying Non-Source Forms. 242 | 243 | You may convey a covered work in object code form under the terms of sections 4 244 | and 5, provided that you also convey the machine-readable Corresponding Source 245 | under the terms of this License, in one of these ways: 246 | 247 | * **a)** Convey the object code in, or embodied in, a physical product 248 | (including a physical distribution medium), accompanied by the Corresponding 249 | Source fixed on a durable physical medium customarily used for software 250 | interchange. 251 | 252 | * **b)** Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by a written offer, 254 | valid for at least three years and valid for as long as you offer spare 255 | parts or customer support for that product model, to give anyone who 256 | possesses the object code either (1) a copy of the Corresponding Source for 257 | all the software in the product that is covered by this License, on a 258 | durable physical medium customarily used for software interchange, for a 259 | price no more than your reasonable cost of physically performing this 260 | conveying of source, or (2) access to copy the Corresponding Source from a 261 | network server at no charge. 262 | 263 | * **c)** Convey individual copies of the object code with a copy of the 264 | written offer to provide the Corresponding Source. This alternative is 265 | allowed only occasionally and noncommercially, and only if you received the 266 | object code with such an offer, in accord with subsection 6b. 267 | 268 | * **d)** Convey the object code by offering access from a designated place 269 | (gratis or for a charge), and offer equivalent access to the Corresponding 270 | Source in the same way through the same place at no further charge. You need 271 | not require recipients to copy the Corresponding Source along with the 272 | object code. If the place to copy the object code is a network server, the 273 | Corresponding Source may be on a different server (operated by you or a 274 | third party) that supports equivalent copying facilities, provided you 275 | maintain clear directions next to the object code saying where to find the 276 | Corresponding Source. Regardless of what server hosts the Corresponding 277 | Source, you remain obligated to ensure that it is available for as long as 278 | needed to satisfy these requirements. 279 | 280 | * **e)** Convey the object code using peer-to-peer transmission, provided you 281 | inform other peers where the object code and Corresponding Source of the 282 | work are being offered to the general public at no charge under subsection 283 | 6d. 284 | 285 | A separable portion of the object code, whose source code is excluded from 286 | the Corresponding Source as a System Library, need not be included in 287 | conveying the object code work. 288 | 289 | A "User Product" is either (1) a "consumer product", which means any 290 | tangible personal property which is normally used for personal, family, or 291 | household purposes, or (2) anything designed or sold for incorporation into 292 | a dwelling. In determining whether a product is a consumer product, doubtful 293 | cases shall be resolved in favor of coverage. For a particular product 294 | received by a particular user, "normally used" refers to a typical or common 295 | use of that class of product, regardless of the status of the particular 296 | user or of the way in which the particular user actually uses, or expects or 297 | is expected to use, the product. A product is a consumer product regardless 298 | of whether the product has substantial commercial, industrial or non- 299 | consumer uses, unless such uses represent the only significant mode of use 300 | of the product. 301 | 302 | "Installation Information" for a User Product means any methods, procedures, 303 | authorization keys, or other information required to install and execute 304 | modified versions of a covered work in that User Product from a modified 305 | version of its Corresponding Source. The information must suffice to ensure 306 | that the continued functioning of the modified object code is in no case 307 | prevented or interfered with solely because modification has been made. 308 | 309 | If you convey an object code work under this section in, or with, or 310 | specifically for use in, a User Product, and the conveying occurs as part of 311 | a transaction in which the right of possession and use of the User Product 312 | is transferred to the recipient in perpetuity or for a fixed term 313 | (regardless of how the transaction is characterized), the Corresponding 314 | Source conveyed under this section must be accompanied by the Installation 315 | Information. But this requirement does not apply if neither you nor any 316 | third party retains the ability to install modified object code on the User 317 | Product (for example, the work has been installed in ROM). 318 | 319 | The requirement to provide Installation Information does not include a 320 | requirement to continue to provide support service, warranty, or updates for 321 | a work that has been modified or installed by the recipient, or for the User 322 | Product in which it has been modified or installed. Access to a network may 323 | be denied when the modification itself materially and adversely affects the 324 | operation of the network or violates the rules and protocols for 325 | communication across the network. 326 | 327 | Corresponding Source conveyed, and Installation Information provided, in 328 | accord with this section must be in a format that is publicly documented 329 | (and with an implementation available to the public in source code form), 330 | and must require no special password or key for unpacking, reading or 331 | copying. 332 | 333 | 334 | ### 7. Additional Terms. 335 | 336 | "Additional permissions" are terms that supplement the terms of this License by 337 | making exceptions from one or more of its conditions. Additional permissions 338 | that are applicable to the entire Program shall be treated as though they were 339 | included in this License, to the extent that they are valid under applicable 340 | law. If additional permissions apply only to part of the Program, that part may 341 | be used separately under those permissions, but the entire Program remains 342 | governed by this License without regard to the additional permissions. 343 | 344 | When you convey a copy of a covered work, you may at your option remove any 345 | additional permissions from that copy, or from any part of it. (Additional 346 | permissions may be written to require their own removal in certain cases when 347 | you modify the work.) You may place additional permissions on material, added by 348 | you to a covered work, for which you have or can give appropriate copyright 349 | permission. 350 | 351 | Notwithstanding any other provision of this License, for material you add to a 352 | covered work, you may (if authorized by the copyright holders of that material) 353 | supplement the terms of this License with terms: 354 | 355 | * **a)** Disclaiming warranty or limiting liability differently from the terms 356 | of sections 15 and 16 of this License; or 357 | 358 | * **b)** Requiring preservation of specified reasonable legal notices or 359 | author attributions in that material or in the Appropriate Legal Notices 360 | displayed by works containing it; or 361 | 362 | * **c)** Prohibiting misrepresentation of the origin of that material, or 363 | requiring that modified versions of such material be marked in reasonable 364 | ways as different from the original version; or 365 | 366 | * **d)** Limiting the use for publicity purposes of names of licensors or 367 | authors of the material; or 368 | 369 | * **e)** Declining to grant rights under trademark law for use of some trade 370 | names, trademarks, or service marks; or 371 | 372 | * **f)** Requiring indemnification of licensors and authors of that material 373 | by anyone who conveys the material (or modified versions of it) with 374 | contractual assumptions of liability to the recipient, for any liability 375 | that these contractual assumptions directly impose on those licensors and 376 | authors. 377 | 378 | All other non-permissive additional terms are considered "further restrictions" 379 | within the meaning of section 10. If the Program as you received it, or any part 380 | of it, contains a notice stating that it is governed by this License along with 381 | a term that is a further restriction, you may remove that term. If a license 382 | document contains a further restriction but permits relicensing or conveying 383 | under this License, you may add to a covered work material governed by the terms 384 | of that license document, provided that the further restriction does not survive 385 | such relicensing or conveying. 386 | 387 | If you add terms to a covered work in accord with this section, you must place, 388 | in the relevant source files, a statement of the additional terms that apply to 389 | those files, or a notice indicating where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the form of a 392 | separately written license, or stated as exceptions; the above requirements 393 | apply either way. 394 | 395 | 396 | ### 8. Termination. 397 | 398 | You may not propagate or modify a covered work except as expressly provided 399 | under this License. Any attempt otherwise to propagate or modify it is void, and 400 | will automatically terminate your rights under this License (including any 401 | patent licenses granted under the third paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your license from a 404 | particular copyright holder is reinstated (a) provisionally, unless and until 405 | the copyright holder explicitly and finally terminates your license, and (b) 406 | permanently, if the copyright holder fails to notify you of the violation by 407 | some reasonable means prior to 60 days after the cessation. 408 | 409 | Moreover, your license from a particular copyright holder is reinstated 410 | permanently if the copyright holder notifies you of the violation by some 411 | reasonable means, this is the first time you have received notice of violation 412 | of this License (for any work) from that copyright holder, and you cure the 413 | violation prior to 30 days after your receipt of the notice. 414 | 415 | Termination of your rights under this section does not terminate the licenses of 416 | parties who have received copies or rights from you under this License. If your 417 | rights have been terminated and not permanently reinstated, you do not qualify 418 | to receive new licenses for the same material under section 10. 419 | 420 | 421 | ### 9. Acceptance Not Required for Having Copies. 422 | 423 | You are not required to accept this License in order to receive or run a copy of 424 | the Program. Ancillary propagation of a covered work occurring solely as a 425 | consequence of using peer-to-peer transmission to receive a copy likewise does 426 | not require acceptance. However, nothing other than this License grants you 427 | permission to propagate or modify any covered work. These actions infringe 428 | copyright if you do not accept this License. Therefore, by modifying or 429 | propagating a covered work, you indicate your acceptance of this License to do 430 | so. 431 | 432 | 433 | ### 10. Automatic Licensing of Downstream Recipients. 434 | 435 | Each time you convey a covered work, the recipient automatically receives a 436 | license from the original licensors, to run, modify and propagate that work, 437 | subject to this License. You are not responsible for enforcing compliance by 438 | third parties with this License. 439 | 440 | An "entity transaction" is a transaction transferring control of an 441 | organization, or substantially all assets of one, or subdividing an 442 | organization, or merging organizations. If propagation of a covered work results 443 | from an entity transaction, each party to that transaction who receives a copy 444 | of the work also receives whatever licenses to the work the party's predecessor 445 | in interest had or could give under the previous paragraph, plus a right to 446 | possession of the Corresponding Source of the work from the predecessor in 447 | interest, if the predecessor has it or can get it with reasonable efforts. 448 | 449 | You may not impose any further restrictions on the exercise of the rights 450 | granted or affirmed under this License. For example, you may not impose a 451 | license fee, royalty, or other charge for exercise of rights granted under this 452 | License, and you may not initiate litigation (including a cross-claim or 453 | counterclaim in a lawsuit) alleging that any patent claim is infringed by 454 | making, using, selling, offering for sale, or importing the Program or any 455 | portion of it. 456 | 457 | 458 | ### 11. Patents. 459 | 460 | A "contributor" is a copyright holder who authorizes use under this License of 461 | the Program or a work on which the Program is based. The work thus licensed is 462 | called the contributor's "contributor version". 463 | 464 | A contributor's "essential patent claims" are all patent claims owned or 465 | controlled by the contributor, whether already acquired or hereafter acquired, 466 | that would be infringed by some manner, permitted by this License, of making, 467 | using, or selling its contributor version, but do not include claims that would 468 | be infringed only as a consequence of further modification of the contributor 469 | version. For purposes of this definition, "control" includes the right to grant 470 | patent sublicenses in a manner consistent with the requirements of this License. 471 | 472 | Each contributor grants you a non-exclusive, worldwide, royalty-free patent 473 | license under the contributor's essential patent claims, to make, use, sell, 474 | offer for sale, import and otherwise run, modify and propagate the contents of 475 | its contributor version. 476 | 477 | In the following three paragraphs, a "patent license" is any express agreement 478 | or commitment, however denominated, not to enforce a patent (such as an express 479 | permission to practice a patent or covenant not to sue for patent infringement). 480 | To "grant" such a patent license to a party means to make such an agreement or 481 | commitment not to enforce a patent against the party. 482 | 483 | If you convey a covered work, knowingly relying on a patent license, and the 484 | Corresponding Source of the work is not available for anyone to copy, free of 485 | charge and under the terms of this License, through a publicly available network 486 | server or other readily accessible means, then you must either (1) cause the 487 | Corresponding Source to be so available, or (2) arrange to deprive yourself of 488 | the benefit of the patent license for this particular work, or (3) arrange, in a 489 | manner consistent with the requirements of this License, to extend the patent 490 | license to downstream recipients. "Knowingly relying" means you have actual 491 | knowledge that, but for the patent license, your conveying the covered work in a 492 | country, or your recipient's use of the covered work in a country, would 493 | infringe one or more identifiable patents in that country that you have reason 494 | to believe are valid. 495 | 496 | If, pursuant to or in connection with a single transaction or arrangement, you 497 | convey, or propagate by procuring conveyance of, a covered work, and grant a 498 | patent license to some of the parties receiving the covered work authorizing 499 | them to use, propagate, modify or convey a specific copy of the covered work, 500 | then the patent license you grant is automatically extended to all recipients of 501 | the covered work and works based on it. 502 | 503 | A patent license is "discriminatory" if it does not include within the scope of 504 | its coverage, prohibits the exercise of, or is conditioned on the non- exercise 505 | of one or more of the rights that are specifically granted under this License. 506 | You may not convey a covered work if you are a party to an arrangement with a 507 | third party that is in the business of distributing software, under which you 508 | make payment to the third party based on the extent of your activity of 509 | conveying the work, and under which the third party grants, to any of the 510 | parties who would receive the covered work from you, a discriminatory patent 511 | license (a) in connection with copies of the covered work conveyed by you (or 512 | copies made from those copies), or (b) primarily for and in connection with 513 | specific products or compilations that contain the covered work, unless you 514 | entered into that arrangement, or that patent license was granted, prior to 28 515 | March 2007. 516 | 517 | Nothing in this License shall be construed as excluding or limiting any implied 518 | license or other defenses to infringement that may otherwise be available to you 519 | under applicable patent law. 520 | 521 | 522 | ### 12. No Surrender of Others' Freedom. 523 | 524 | If conditions are imposed on you (whether by court order, agreement or 525 | otherwise) that contradict the conditions of this License, they do not excuse 526 | you from the conditions of this License. If you cannot convey a covered work so 527 | as to satisfy simultaneously your obligations under this License and any other 528 | pertinent obligations, then as a consequence you may not convey it at all. For 529 | example, if you agree to terms that obligate you to collect a royalty for 530 | further conveying from those to whom you convey the Program, the only way you 531 | could satisfy both those terms and this License would be to refrain entirely 532 | from conveying the Program. 533 | 534 | 535 | ### 13. Use with the GNU Affero General Public License. 536 | 537 | Notwithstanding any other provision of this License, you have permission to link 538 | or combine any covered work with a work licensed under version 3 of the GNU 539 | Affero General Public License into a single combined work, and to convey the 540 | resulting work. The terms of this License will continue to apply to the part 541 | which is the covered work, but the special requirements of the GNU Affero 542 | General Public License, section 13, concerning interaction through a network 543 | will apply to the combination as such. 544 | 545 | 546 | ### 14. Revised Versions of this License. 547 | 548 | The Free Software Foundation may publish revised and/or new versions of the GNU 549 | General Public License from time to time. Such new versions will be similar in 550 | spirit to the present version, but may differ in detail to address new problems 551 | or concerns. 552 | 553 | Each version is given a distinguishing version number. If the Program specifies 554 | that a certain numbered version of the GNU General Public License "or any later 555 | version" applies to it, you have the option of following the terms and 556 | conditions either of that numbered version or of any later version published by 557 | the Free Software Foundation. If the Program does not specify a version number 558 | of the GNU General Public License, you may choose any version ever published by 559 | the Free Software Foundation. 560 | 561 | If the Program specifies that a proxy can decide which future versions of the 562 | GNU General Public License can be used, that proxy's public statement of 563 | acceptance of a version permanently authorizes you to choose that version for 564 | the Program. 565 | 566 | Later license versions may give you additional or different permissions. 567 | However, no additional obligations are imposed on any author or copyright holder 568 | as a result of your choosing to follow a later version. 569 | 570 | 571 | ### 15. Disclaimer of Warranty. 572 | 573 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 574 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER 575 | PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 576 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 577 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE 578 | QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 579 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 580 | 581 | 582 | ### 16. Limitation of Liability. 583 | 584 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY 585 | COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS 586 | PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, 587 | INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 588 | THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED 589 | INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE 590 | PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY 591 | HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 592 | 593 | ### 17. Interpretation of Sections 15 and 16. 594 | 595 | If the disclaimer of warranty and limitation of liability provided above cannot 596 | be given local legal effect according to their terms, reviewing courts shall 597 | apply local law that most closely approximates an absolute waiver of all civil 598 | liability in connection with the Program, unless a warranty or assumption of 599 | liability accompanies a copy of the Program in return for a fee. 600 | 601 | END OF TERMS AND CONDITIONS 602 | 603 | 604 | How to Apply These Terms to Your New Programs 605 | --------------------------------------------- 606 | 607 | If you develop a new program, and you want it to be of the greatest possible use 608 | to the public, the best way to achieve this is to make it free software which 609 | everyone can redistribute and change under these terms. 610 | 611 | To do so, attach the following notices to the program. It is safest to attach 612 | them to the start of each source file to most effectively state the exclusion of 613 | warranty; and each file should have at least the "copyright" line and a pointer 614 | to where the full notice is found. 615 | 616 | 617 | Copyright (C) 618 | 619 | This program is free software: you can redistribute it and/or modify it 620 | under the terms of the GNU General Public License as published by the Free 621 | Software Foundation, either version 3 of the License, or (at your option) 622 | any later version. 623 | 624 | This program is distributed in the hope that it will be useful, but WITHOUT 625 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 626 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 627 | more details. 628 | 629 | You should have received a copy of the GNU General Public License along with 630 | this program. If not, see . 631 | 632 | Also add information on how to contact you by electronic and paper mail. 633 | 634 | If the program does terminal interaction, make it output a short notice like 635 | this when it starts in an interactive mode: 636 | 637 | Copyright (C) 638 | This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 639 | This is free software, and you are welcome to redistribute it under certain 640 | conditions; type 'show c' for details. 641 | 642 | The hypothetical commands 'show w' and 'show c' should show the appropriate 643 | parts of the General Public License. Of course, your program's commands might be 644 | different; for a GUI interface, you would use an "about box". 645 | 646 | You should also get your employer (if you work as a programmer) or school, if 647 | any, to sign a "copyright disclaimer" for the program, if necessary. For more 648 | information on this, and how to apply and follow the GNU GPL, see 649 | <>. 650 | 651 | The GNU General Public License does not permit incorporating your program into 652 | proprietary programs. If your program is a subroutine library, you may consider 653 | it more useful to permit linking proprietary applications with the library. If 654 | this is what you want to do, use the GNU Lesser General Public License instead 655 | of this License. But first, please read 656 | <>. 657 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Never Lose 2 | ========== 3 | 4 | This Chrome extension save all web pages you viewed to the Wayback Machine 5 | 6 | [Download](https://github.com/kissarat/never-lose/raw/master/build/never-lose.crx) 7 | 8 | Sites excluded by default: 9 | * archive.org 10 | * archive.is 11 | * facebook.com (only private URLs) 12 | * vk.com (only private URLs) 13 | * Search Eninges (Google, Yahoo, Bind, Yahoo, Yandex and others) 14 | * Any IP addresses and localhost 15 | * [Well known sites](chrome/list/well_known.js) 16 | * [Advertise](chrome/list/advertise.js) 17 | * 300+ [porn sites](chrome/list/porn.js) 18 | 19 | You can change these rules in Options page using regular expressions 20 | 21 | ![Options page](https://upload.wikimedia.org/wikipedia/commons/b/b9/Never_Lose_0.3.0_options.png) 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | No versions are supported for now. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Please report any vulnerability to [kissarat@gmail.com](mailto:kissarat@gmail.com) 10 | and tell why do you want to use this extension 11 | -------------------------------------------------------------------------------- /build/never-lose.crx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1f93a81b2eaed64b11ad4fede5c1a257643e02f28c82d0aa00b6922d8248ae8b 3 | size 110989 4 | -------------------------------------------------------------------------------- /chrome/images/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kissarat/never-lose/03e34d4c8ff1da05a8eed2a32c8b17ae3afcb854/chrome/images/icon-128.png -------------------------------------------------------------------------------- /chrome/images/icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kissarat/never-lose/03e34d4c8ff1da05a8eed2a32c8b17ae3afcb854/chrome/images/icon-16.png -------------------------------------------------------------------------------- /chrome/images/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kissarat/never-lose/03e34d4c8ff1da05a8eed2a32c8b17ae3afcb854/chrome/images/icon-32.png -------------------------------------------------------------------------------- /chrome/images/icon-64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kissarat/never-lose/03e34d4c8ff1da05a8eed2a32c8b17ae3afcb854/chrome/images/icon-64.png -------------------------------------------------------------------------------- /chrome/lib/lodash.js: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ee26934f8b351e5341f78d6a320f581b30c131edf9de8a9e6ab1679668b88114 3 | size 534841 4 | -------------------------------------------------------------------------------- /chrome/list/advertise.js: -------------------------------------------------------------------------------- 1 | const advertise = ` 2 | # Advertise 3 | craigslist.org 4 | doubleclick.net 5 | googleadservices.com 6 | onclickads.net 7 | popads.net 8 | ` 9 | -------------------------------------------------------------------------------- /chrome/list/porn.js: -------------------------------------------------------------------------------- 1 | var porn = ` 2 | # Porn sites 3 | 101boyvideos.com 4 | 101hotguys.com 5 | 18boybeauty.com 6 | 18gayteen.com 7 | 24hentai.com 8 | 4boystube.com 9 | 69games.xxx 10 | 88fuck.com 11 | abouttwinks.com 12 | actual-porn.org 13 | adultblogtoplist.com 14 | adultvideofinder.com 15 | allboner.com 16 | allgayteenboys.com 17 | alluncutcocks.tumblr.com 18 | alotporn.com 19 | alphamusclehunks.tumblr.com 20 | always-nude.tumblr.com 21 | amateur-gay-sex-videos-only.tumblr.com 22 | amateur-gay-sex-videos.tumblr.com 23 | amateurgaylovin.tumblr.com 24 | amazon.com 25 | analgaytwinks.com 26 | anotherpornblog.tumblr.com 27 | apetube.com 28 | apina.biz 29 | asiandragons.tumblr.com 30 | avn.com 31 | awsum.me 32 | babe-lounge.com 33 | babepedia.com 34 | badjojo.com 35 | beachandpool.net 36 | beardsandforeskin.tumblr.com 37 | befuck.com 38 | best-paypornsites.com 39 | bestpornstardb.com 40 | big-dick-pics.tumblr.com 41 | big-thick-hard-uncut-cock.tumblr.com 42 | bigdickclub.tumblr.com 43 | bigggggggggggg.tumblr.com 44 | blackcock.tumblr.com 45 | blackgayporno.tumblr.com 46 | bonertube.com 47 | bootytape.com 48 | borrowedmalecelebs.tumblr.com 49 | boy18tube.com 50 | boycall.com 51 | boycollector.net 52 | boyfriendtv.com 53 | boyself.com 54 | boysontube.com 55 | boyspiss.tumblr.com 56 | boywankblog.com 57 | bravotube.net 58 | camtogays.com 59 | capullos.tumblr.com 60 | celebuzz.com 61 | chan.sankakucomplex.com 62 | chulazosxxx.com 63 | cutegaytwink.com 64 | daftporn.com 65 | dailee.com 66 | dansmovies.com 67 | definebabe.com 68 | deviantclip.com 69 | dirtyrottenwhore.com 70 | dragonballzyaoi.com 71 | drtuber.com 72 | efukt.com 73 | elephanttube.com 74 | entnt.com 75 | eporner.com 76 | erikforeskin.tumblr.com 77 | erooups.com 78 | erotica7.com 79 | eroxia.com 80 | expmceleb.tumblr.com 81 | extremetube.com 82 | fakku.net 83 | famous-skin.tumblr.com 84 | famousmennakeduk.tumblr.com 85 | fapdu.com 86 | femdom-tube.xxx 87 | findtubes.com 88 | fistingdudes.tumblr.com 89 | fistingmen.tumblr.com 90 | foreskin1.tumblr.com 91 | fortheloveofasianmen.tumblr.com 92 | forum.oneclickchicks.com 93 | forum.xnxx.com 94 | forumophilia.com 95 | freegayporn.com 96 | freeones.com 97 | freudbox.com 98 | fuckuh.com 99 | fuckyeahhugepenis.tumblr.com 100 | funnyboy86.tumblr.com 101 | furrific.tumblr.com 102 | fuskator.com 103 | fux.com 104 | gay-boy-sex.net 105 | gay-daddy-mature-videos.tumblr.com 106 | gay-wet-dreams-returns.tumblr.com 107 | gay.sex.com 108 | gayandpissingguys.tumblr.com 109 | gaybearmatt.tumblr.com 110 | gayfuror.com 111 | gayfurryfun.tumblr.com 112 | gaymaletube.com 113 | gaypissingmen.tumblr.com 114 | gayplanet.easyxtubes.com 115 | gaypornium.com 116 | gayrookievideos.com 117 | gayroulettechat.com 118 | gaysexishilarious.tumblr.com 119 | gaysteensboys.com 120 | gayteenboylinks.com 121 | gayteenlove.com 122 | gayteenvideo.org 123 | gaytube.com 124 | gayvideoshack.tumblr.com 125 | gelbooru.com 126 | givemegay.com 127 | gkbdsm.tumblr.com 128 | gmlc1213.tumblr.com 129 | gotenboner.com 130 | gotgayporn.com 131 | guystricked.com 132 | h2porn.com 133 | hairyhunkymen.tumblr.com 134 | hairymeat.tumblr.com 135 | handsomedaddies.tumblr.com 136 | hard-yaoi.tumblr.com 137 | hclips.com 138 | hdhentaisex.com 139 | hdporn.net 140 | hentai-foundry.com 141 | hentai.tc 142 | hentai4manga.com 143 | hentairules.net 144 | hentaischool.com 145 | hide-porn.winsite.com 146 | holeboy.tumblr.com 147 | hollywoodlife.com 148 | homosexualtube.com 149 | hot-celebrity-fakes.tumblr.com 150 | hotandnaked99.tumblr.com 151 | hotbears.tumblr.com 152 | hotgaycartoons.tumblr.com 153 | hotgaylist.com 154 | hugethingsss.tumblr.com 155 | hunkdude.tumblr.com 156 | hunkytwinks.tumblr.com 157 | icantbelievehesnaked.tumblr.com 158 | ilovecockuncut.tumblr.com 159 | imagearn.com 160 | incestandotherstuff.tumblr.com 161 | intactguys.com 162 | intactmen.tumblr.com 163 | intostraightnakedguys.tumblr.com 164 | inxporn.com 165 | itsallgay.eu 166 | itsnotpornipromise.tumblr.com 167 | jailcop.tumblr.com 168 | jockdad38.tumblr.com 169 | jockertube.com 170 | jocknights.com 171 | justjared.com 172 | justusboys.com 173 | keepersecurity.com 174 | keezmovies.com 175 | kindgirls.com 176 | laineygossip.com 177 | largethickcock.tumblr.com 178 | latinadmirer.tumblr.com 179 | linkcollector.net 180 | lockerroomguys.tumblr.com 181 | lolhentai.net 182 | lustpin.com 183 | luv4daddy.tumblr.com 184 | madthumbs.com 185 | majdad-celebs.tumblr.com 186 | malecelebritynudes.tumblr.com 187 | manhub.com 188 | manpussymania.tumblr.com 189 | manroulette.com 190 | maturechang.tumblr.com 191 | maturegaystories.com 192 | maxim.com 193 | mediadetective.com 194 | mefffisto.tumblr.com 195 | megiant1.tumblr.com 196 | mexigreek.tumblr.com 197 | militaryhotness.tumblr.com 198 | militarymen.tumblr.com 199 | militarymenglory.tumblr.com 200 | milkingcocks.tumblr.com 201 | milliondicks.eu 202 | mofosex.com 203 | myfavgayvideos.tumblr.com 204 | myhentai.tv 205 | mypornbible.com 206 | myporngay.com 207 | myxvids.com 208 | naked-straight-men.tumblr.com 209 | nakedguys99.tumblr.com 210 | nakednews.com 211 | nkdmalecelebs.tumblr.com 212 | nudevista.com 213 | nurglesnymphs.com 214 | nuvid.com 215 | obeyyourfather.tumblr.com 216 | onlydudes.com 217 | onlygaystories.com 218 | oofahpapa.tumblr.com 219 | orgasm.com 220 | oztwink.tumblr.com 221 | pdxsuitsucker.tumblr.com 222 | peachyforum.com 223 | perezhilton.com 224 | pervclips.com 225 | petebrownuk.tumblr.com 226 | phapit.com 227 | phun.org 228 | pichack.com 229 | pissandgroan.tumblr.com 230 | planetsuzy.org 231 | playforceone.com 232 | playporngames.com 233 | plublogs.com 234 | porn-wanted.com 235 | pornative.com 236 | pornbb.org 237 | pornbits.net 238 | porncor.com 239 | pornerbros.com 240 | pornheed.com 241 | pornhost.com 242 | pornhub.com 243 | pornhunks.tumblr.com 244 | pornicom.com 245 | pornjog.com 246 | pornmaxim.com 247 | pornmd.com 248 | pornpin.com 249 | pornplanner.com 250 | pornrabbit.com 251 | porntitan.com 252 | proporn.com 253 | punchpin.com 254 | pussytorrents.org 255 | randomale.net 256 | ricanguys.tumblr.com 257 | rockettube.com 258 | savvyifyanasty.tumblr.com 259 | seniorsan.tumblr.com 260 | sexforums.com 261 | sextubespot.com 262 | sexwithdad.tumblr.com 263 | sexyfuckgames.com 264 | sexymatureworldwide.tumblr.com 265 | simply-hentai.com 266 | slutload.com 267 | small-cut-cock.tumblr.com 268 | smutty.com 269 | soft-flaccid-uncut-cock.tumblr.com 270 | spankbang.com 271 | speci-men.tumblr.com 272 | spyboy24.tumblr.com 273 | spycamfromguys.com 274 | spyonmales.tumblr.com 275 | straightguynaked.tumblr.com 276 | straightguyscocksout.tumblr.com 277 | sunporno.com 278 | surfgayvideo.com 279 | sweetasiantwinks.tumblr.com 280 | teenboysrank.com 281 | teensbodybuilding.tumblr.com 282 | teensgaysvideo.com 283 | the-pork.com 284 | theboyrook.tumblr.com 285 | thegayteentube.com 286 | thehollywoodgossip.com 287 | thenewporn.com 288 | thick-cocks.tumblr.com 289 | thongsaroundtheworld.com 290 | tjoob.com 291 | tnaflix.com 292 | topfreepornvideos.com 293 | totallynsfw.com 294 | tube8.com 295 | tubegalore.com 296 | tubehentai.com 297 | tubewankers.com 298 | twinkblog.pichack.com 299 | twinkteencum.tumblr.com 300 | txbibear.tumblr.com 301 | updatetube.com 302 | uselessjunk.com 303 | userporn.com 304 | vintagepinupgirls.net 305 | vpornvideos.com 306 | wankoz.com 307 | wattube.com 308 | wetplace.com 309 | woofy-bears.tumblr.com 310 | wreckedbybbc.tumblr.com 311 | wtfpeople.com 312 | xbabe.com 313 | xhamster.com 314 | xnxx.com 315 | xvideos.com 316 | xxxbunker.com 317 | xxxymovies.com 318 | yaoi-games.com 319 | yeswegays.com 320 | youjizz.com 321 | youngboyvideos.com 322 | youngerforeskin.tumblr.com 323 | youporn.com 324 | youporngay.com 325 | youramateurporn.com 326 | yourlustmovies.com 327 | yummy-yaoi.tumblr.com 328 | ` 329 | -------------------------------------------------------------------------------- /chrome/list/well_known.js: -------------------------------------------------------------------------------- 1 | const well_known = ` 2 | alipay.com 3 | apple.com 4 | aws.amazon.com 5 | baidu.com 6 | bind.com 7 | coccoc.com 8 | dropbox.com 9 | globo.com 10 | hao123.com 11 | jd.com 12 | linkedin.com 13 | live.com 14 | mail.ru 15 | microsoftonline.com 16 | msn.com 17 | naver.com 18 | office.com 19 | ok.ru 20 | paypal.com 21 | qq.com 22 | sina.com.cn 23 | skype.com 24 | soso.com 25 | whatsapp.com 26 | whatsapp.com 27 | yahoo.com 28 | ` 29 | -------------------------------------------------------------------------------- /chrome/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "Never Lose", 4 | "short_name": "Never Lose", 5 | "description": "This extension save all web pages you viewed to the Wayback Machine", 6 | "version": "0.3.2", 7 | "icons": { 8 | "16": "/images/icon-16.png", 9 | "32": "/images/icon-32.png", 10 | "64": "/images/icon-64.png", 11 | "128": "/images/icon-128.png" 12 | }, 13 | "homepage_url": "https://github.com/kissarat/never-lose/blob/master/README.md", 14 | "options_page": "options/options.html", 15 | "permissions": [ 16 | "", 17 | "activeTab", 18 | "tabs", 19 | "storage", 20 | "webNavigation", 21 | "webRequest", 22 | "webRequestBlocking" 23 | ], 24 | "background": { 25 | "scripts": ["wayback.js"] 26 | }, 27 | "browser_action": { 28 | "default_icon": { 29 | "16": "/images/icon-16.png", 30 | "32": "/images/icon-32.png" 31 | }, 32 | "default_time": "Show it on archive.org" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chrome/options/options.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | min-height: 100vh; 4 | } 5 | 6 | form { 7 | height: 100vh; 8 | display: flex; 9 | flex-direction: column; 10 | } 11 | 12 | label > i { 13 | float: right; 14 | color: grey; 15 | } 16 | 17 | .form-group { 18 | flex: 1; 19 | display: flex; 20 | flex-direction: column; 21 | margin-top: 8px; 22 | } 23 | 24 | textarea { 25 | flex: 1; 26 | white-space: nowrap; 27 | font-family: "Courier New", monospace; 28 | } 29 | 30 | .buttons { 31 | text-align: right; 32 | margin-bottom: 16px; 33 | } 34 | 35 | #add-domain { 36 | float: left; 37 | } 38 | -------------------------------------------------------------------------------- /chrome/options/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Never Lose 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 |
19 | 27 | 28 |
29 |
30 | 31 | 32 | 33 |
34 |
35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /chrome/options/options.js: -------------------------------------------------------------------------------- 1 | const ui = { 2 | textarea: 'textarea', 3 | success: '.alert-success', 4 | warning: '.alert-warning', 5 | danger: '.alert-danger' 6 | } 7 | 8 | for (const name in ui) { 9 | ui[name] = document.querySelector(ui[name]) 10 | } 11 | 12 | function bootstrapAlert(type, text, timeout) { 13 | const alert = ui[type] 14 | alert.innerHTML = text || '' 15 | alert.style.display = text ? 'block' : ' none' 16 | if (timeout) { 17 | if (alert.tid) { 18 | clearTimeout(alert.tid) 19 | } 20 | alert.tid = setTimeout(function () { 21 | alert.style.display = 'none' 22 | }, timeout * 1000) 23 | } 24 | } 25 | 26 | bootstrapAlert('warning', 'Loading...') 27 | 28 | function domainToRegex(domain) { 29 | domain = domain 30 | .replace('www.', '') 31 | let regex = domain.replace(/\./g, '\\.') 32 | regex = `^https?:\\/{2}([^\\/]+\\.)?${regex}\\/` 33 | return {domain, regex} 34 | } 35 | 36 | const buttons = { 37 | save() { 38 | // const rules = ui.textarea.value 39 | const rules = 40 | _.uniq(ui.textarea.value.split(/\s*\n\s*/)) 41 | .map(s => '#' === s[0] ? '\n' + s : s) 42 | .join('\n') 43 | 44 | chrome.storage.sync.set({rules}, function () { 45 | bootstrapAlert('success', 'Success', 30) 46 | }) 47 | }, 48 | 49 | reset () { 50 | chrome.storage.sync.clear(function () { 51 | location.reload() 52 | }) 53 | }, 54 | 55 | 'add-domain': function () { 56 | let url = prompt('Enter URL') 57 | if (!url) { 58 | bootstrapAlert('danger', 'No URL', 10) 59 | return 60 | } 61 | const match = /^((ht|f)tps?:\/\/)?([^\/]+)/.exec(url) 62 | if (match) { 63 | const {regex, domain} = domainToRegex(match[3]) 64 | let comment = ` # ${domain}\n` 65 | if ('#' === ui.textarea.value[0]) { 66 | comment += '\n' 67 | } 68 | ui.textarea.value = regex + comment + ui.textarea.value 69 | } 70 | else { 71 | bootstrapAlert('danger', 'Invalid URL ' + url, 5) 72 | } 73 | } 74 | } 75 | 76 | // [].map.call(document.querySelectorAll('[target=_blank]'), s => /^https?:\/\/(www\.)?([^\/]+)\/$/.exec(s.href)).filter(s => s).map(s => s[2]).sort().join(' ') 77 | function processDomainList(list) { 78 | if ('string' === typeof list) { 79 | list = list.split(/\s*\n\s*/g) 80 | } 81 | return list 82 | .map(s => s.trim()) 83 | .map((s) => s && s.indexOf('#') < 0 ? domainToRegex(s).regex : s) 84 | } 85 | 86 | chrome.storage.sync.get('rules', function ({rules}) { 87 | if (!rules) { 88 | rules = [ 89 | '# Special URLs', 90 | /^chrome(-extension)?:/, 91 | /^https?:\/{2}\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/, 92 | /^https?:\/{2}[^\/]*localhost/, 93 | /^https?:\/{2}[^\/]*\.local/, 94 | 95 | '\n# Well known sites', 96 | /^https?:\/{2}[^\/]*facebook\.com\/(messages|games|livemap|onthisday|translations|editor|saved)\//, 97 | /^https?:\/{2}[^\/]*google(\.com)?\.([a-z]+)/, 98 | /^https?:\/{2}[^\/]*(google|yahoo)(\.co)\.([a-z]{2})/, 99 | /^https?:\/{2}[^\/]*vk\.com\/(im|video|friends|feed|groups|edit|apps)(\?act=\w+)$/, 100 | /^https?:\/{2}[^\/]*yandex\.([a-z]+)/, 101 | /^https?:\/{2}t\.co\//, 102 | /^https?:\/{2}[gt]mail\.com\//, 103 | /^https?:\/{2}(web|api)\.telegram\.org\// 104 | ] 105 | .map(s => 'string' == typeof s ? s : s.toString().slice(1, -1)) 106 | .concat(processDomainList(well_known)) 107 | .concat(processDomainList(advertise)) 108 | // .concat(processDomainList(porn)) 109 | .join('\n') 110 | } 111 | 112 | ui.textarea.value = rules.replace(/\n\n\n/g, '\n\n') 113 | if ('function' === typeof ui.textarea.setSelectionRange) { 114 | ui.textarea.setSelectionRange(0, 0) 115 | } 116 | ui.textarea.focus() 117 | 118 | for (const name in buttons) { 119 | document 120 | .getElementById(name) 121 | .addEventListener('click', buttons[name]) 122 | } 123 | 124 | bootstrapAlert('warning') 125 | }) 126 | -------------------------------------------------------------------------------- /chrome/wayback.js: -------------------------------------------------------------------------------- 1 | const urls = {} 2 | const queue = [] 3 | let last = Date.now() 4 | 5 | let excludes = [] 6 | 7 | const _ = { 8 | random(min, max) { 9 | return Math.round(min + Math.random() * (max - min)) 10 | }, 11 | 12 | extendKeys(target, source, ...keys) { 13 | keys.forEach(function (key) { 14 | target[key] = source[key] 15 | }) 16 | return target 17 | } 18 | } 19 | 20 | function find(url) { 21 | if (url && url.split) { 22 | url = url.split('#')[0] 23 | } 24 | else { 25 | if (url) { 26 | console.error(url) 27 | } 28 | throw new Error('invalid url') 29 | } 30 | return new Promise(function (resolve, reject) { 31 | let info = urls[url] 32 | if (!info) { 33 | urls[url] = info = { 34 | url: url, 35 | start: Date.now() 36 | } 37 | } 38 | if (excludes.some(rex => rex.test(url))) { 39 | reject({ 40 | excluded: true, 41 | url: url 42 | }) 43 | } 44 | else { 45 | resolve(info) 46 | } 47 | }) 48 | } 49 | 50 | function save(info) { 51 | return new Promise(function (resolve) { 52 | urls[info.url] = info 53 | resolve(info) 54 | }) 55 | } 56 | 57 | chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) { 58 | if ('complete' === changeInfo.status) { 59 | find(tab.url).then(function (info) { 60 | if (!info.archived) { 61 | setTimeout(archiveClosest, _.random(50, 500), info.url) 62 | } 63 | }) 64 | } 65 | }) 66 | 67 | function request(method, url) { 68 | const xhr = new XMLHttpRequest() 69 | xhr.open(method, url) 70 | xhr.send(null) 71 | return xhr 72 | } 73 | 74 | function archive(url) { 75 | const now = Date.now() 76 | if (now - last > 500) { 77 | request('POST', 'https://web.archive.org/save/' + url).addEventListener('load', function () { 78 | find(url).then(function (info) { 79 | info.archived = Date.now() 80 | save(info) 81 | }) 82 | }) 83 | last = now 84 | } 85 | else { 86 | queue.push(url) 87 | setTimeout(() => archive(queue.unshift()), _.random(50, 500), url) 88 | } 89 | } 90 | 91 | function requestClosest(url) { 92 | return find(url) 93 | .then(function (info) { 94 | return new Promise(function (resolve, reject) { 95 | if (info && info.closest) { 96 | resolve(info) 97 | } 98 | else if (200 === info.statusCode) { 99 | const xhr = request('GET', 'https://archive.org/wayback/available?url=' + info.url) 100 | xhr.addEventListener('load', function (e) { 101 | try { 102 | const snapshots = JSON.parse(e.target.responseText).archived_snapshots 103 | info.closest = snapshots.closest 104 | save(info).then(resolve) 105 | } 106 | catch (ex) { 107 | reject(ex) 108 | } 109 | }); 110 | xhr.addEventListener('error', reject) 111 | } 112 | }) 113 | }) 114 | } 115 | 116 | function archiveClosest(url) { 117 | requestClosest(url).then(function (info) { 118 | if (info.closest) { 119 | var t = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(info.closest.timestamp) 120 | if (t) { 121 | t = Date.UTC(+t[1], t[2] - 1, +t[3], +t[4], +t[5], +t[6]) 122 | const delta = Date.now() - t 123 | if (delta > 3600 * 1000) { 124 | archive(info.url) 125 | } 126 | } 127 | else { 128 | console.error('Invalid timestamp ' + t) 129 | } 130 | } 131 | else if (200 === info.statusCode) { 132 | archive(info.url) 133 | } 134 | }) 135 | } 136 | 137 | chrome.browserAction.onClicked.addListener(function (tab) { 138 | requestClosest(tab.url) 139 | .then(function (info) { 140 | if (info.closest) { 141 | chrome.tabs.create({url: info.closest.url}) 142 | } 143 | else { 144 | chrome.tabs.create({url: 'https://web.archive.org/web/*/' + info.url}) 145 | } 146 | }) 147 | .catch(function (err) { 148 | if (err.excluded) { 149 | alert(`The url ${err.url} is in excluded list`) 150 | } 151 | else { 152 | chrome.tabs.create({url: 'https://web.archive.org/web/*/' + info.url}) 153 | } 154 | }) 155 | }) 156 | 157 | function loadRules() { 158 | chrome.storage.sync.get('rules', function ({rules}) { 159 | rules = rules ? rules.split('\n') : [] 160 | excludes = [ 161 | /^https?:\/{2}[^\/]*archive\.org/, 162 | /^https?:\/{2}[^\/]*archive\.is/, 163 | /(kissarat|11351378)/ 164 | ] 165 | rules 166 | .map(function (s) { 167 | const m = /^(.*)\s+#(.*)$/.exec(s) 168 | return m ? m[1] : s 169 | }) 170 | .filter(s => s.trim()) 171 | .forEach(function (rule) { 172 | excludes.push(new RegExp(rule)) 173 | }) 174 | }) 175 | } 176 | 177 | chrome.storage.onChanged.addListener(loadRules) 178 | 179 | chrome.webRequest.onHeadersReceived.addListener(function (res) { 180 | if ('main_frame' === res.type && 'GET' === res.method) { 181 | find(res.url).then(function (info) { 182 | save(_.extendKeys(info, res, 'statusCode')) 183 | }) 184 | } 185 | }, 186 | {urls: [""]} 187 | ) 188 | 189 | loadRules() -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "never-lose", 3 | "version": "0.3.2", 4 | "description": "This Chrome extension save all web pages you viewed to the Wayback Machine", 5 | "main": "", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "version": "node utils/version.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/kissarat/never-lose.git" 13 | }, 14 | "keywords": [ 15 | "archive.org", 16 | "history", 17 | "paranoia" 18 | ], 19 | "author": "Taras Labiak ", 20 | "license": "GPL-3.0", 21 | "bugs": { 22 | "url": "https://github.com/kissarat/never-lose/issues" 23 | }, 24 | "homepage": "https://github.com/kissarat/never-lose#readme", 25 | "dependencies": { 26 | "lodash": "^4.16.4" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /utils/version.js: -------------------------------------------------------------------------------- 1 | const {readFileSync, writeFileSync} = require('fs') 2 | const {last} = require('lodash') 3 | 4 | const version = last(process.argv) 5 | const versionRegex = /\d+\.\d+\.\d+/ 6 | if (!versionRegex.test(version)) { 7 | console.error('Invalid version: ' + version) 8 | process.exit(1) 9 | } 10 | 11 | function update(filename) { 12 | const file = readFileSync(__dirname + '/../' + filename) 13 | .toString('utf8') 14 | .replace(versionRegex, version) 15 | writeFileSync(filename, file) 16 | } 17 | 18 | update('package.json') 19 | update('README.md') 20 | update('chrome/manifest.json') 21 | --------------------------------------------------------------------------------