├── LICENSE ├── README.md └── source ├── _locales ├── en_US │ └── messages.json └── it │ └── messages.json ├── img ├── amo.svg ├── copylinks.svg └── github.svg ├── js ├── background.js ├── common.js └── content-script.js ├── manifest.json └── options ├── options.css ├── options.html └── options.js /LICENSE: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. 374 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CopyLinks PlusPlus 2 | 3 | Copylinks++ extracts all links from all opened tabs, sorts them, removes duplicates, and copies them to clipboard. 4 | 5 | Copylinks++ allow you to choose where to copy from: 6 | - current tab 7 | - all tabs in current window 8 | - all tabs in all windows 9 | 10 | Copylinks++ allow you to filter what to copy: 11 | - all links 12 | - magnet links 13 | - links to listed domains (ie: links to cyberlocker files) 14 | - links filtered by regular expressions 15 | 16 | It's possible to add domain to list by contextual menu 17 | 18 | Options page let you: 19 | - choose quick action for toolbar button (or by keyboard shortcut[alt+z]) 20 | - decide actions to show in contextual menu 21 | - set your own list of domains 22 | 23 | List of destination domains when saving is automatically sorted and duplicates are removed. 24 | You can add domain to list with contextual menu item (current domain or link domain) 25 | 26 | It is a companion for download manager like jdownloader. 27 | 28 | ## Need Help - Localization 29 | 30 | I'm looking for some people to translate CopyLinks++ 31 | If you're interested, please fork it and add your language. 32 | 33 | Thanks! 34 | -------------------------------------------------------------------------------- /source/_locales/en_US/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName":{"message":"Copylinks++"}, 3 | "appDesc":{"message":"Copy to clipboard all links from pages with one click!"}, 4 | "appButtonDesc":{"message":"Copylinks++"}, 5 | "quickAction":{"message":"Activate quick action"}, 6 | "button":{"message":"Button Settings"}, 7 | "where":{"message":"Copy links from:"}, 8 | "current":{"message":"Current Tab"}, 9 | "alltabs":{"message":"Current Window"}, 10 | "alltabsallwindows":{"message":"All Windows"}, 11 | "notificationTitle":{"message":"Copylinks++"}, 12 | "notificationMessage":{"message":"Number"}, 13 | "numb":{"message":"Link(s) copied"}, 14 | "fromTab": {"message":" from n. "}, 15 | "tabs": {"message":" tab(s)"}, 16 | "all":{"message":"All links"}, 17 | "torrent":{"message":"Magnet links"}, 18 | "listed":{"message":"Listed Domains"}, 19 | "domainlist":{"message":"Listed Domains - One for line"}, 20 | "torrentlisted":{"message":"Magnet and Listed Domains"}, 21 | "filter":{"message":"Link types:"}, 22 | "context":{"message":"Context Menu"}, 23 | "adddomain":{"message":"Add to listed domains"}, 24 | "addsite":{"message":"Add current domain to list"}, 25 | "addlinksite":{"message":"Add link domain to list"}, 26 | "options":{"message":"Open options"}, 27 | "optionsTitle":{"message":"Copylinks++ Options"}, 28 | "tab_button":{"message":"Action Button"}, 29 | "tab_context":{"message":"Context Menu"}, 30 | "tab_listed":{"message":"Listed Domains"}, 31 | "tab_regex":{"message":"Regex List"}, 32 | "regex":{"message":"Regular Expression"}, 33 | "regexlist":{"message":"Regex List - One for line"}, 34 | "tab_general":{"message":"General"}, 35 | "excludepinnedT":{"message":"Tabs"}, 36 | "excludepinned":{"message":"Esclude pinned tabs"}, 37 | "dupliT":{"message":"Links"}, 38 | "dupli":{"message":"Sort Links e remove duplicates"}, 39 | "noti":{"message":"Notification Enabled"}, 40 | "notiT":{"message":"Notification"} 41 | } 42 | -------------------------------------------------------------------------------- /source/_locales/it/messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "appName":{"message":"Copylinks++"}, 3 | "appDesc":{"message":"Copia negli appunti tutti i link dalle pagine"}, 4 | "appButtonDesc":{"message":"Copylinks++"}, 5 | "quickAction":{"message":"Copia negli appunti tutti i link!"}, 6 | "button":{"message":"Azione del pulsante"}, 7 | "where":{"message":"Copia i link da:"}, 8 | "current":{"message":"Scheda corrente"}, 9 | "alltabs":{"message":"Finestra corrente"}, 10 | "alltabsallwindows":{"message":"Tutte le finestre"}, 11 | "notificationTitle":{"message":"Copylinks++"}, 12 | "notificationMessage":{"message":"Numero"}, 13 | "numb":{"message":"Link copiati"}, 14 | "fromTab": {"message":" da n. "}, 15 | "tabs": {"message":" scheda/e"}, 16 | "all":{"message":"Tutti i link"}, 17 | "torrent":{"message":"Link Magnet"}, 18 | "listed":{"message":"Domini in elenco"}, 19 | "domainlist":{"message":"Un dominio per linea"}, 20 | "torrentlisted":{"message":"Link Magnet && Domini in elenco"}, 21 | "filter":{"message":"Tipi di link:"}, 22 | "context":{"message":"Menù contestuale"}, 23 | "adddomain":{"message":"Aggiungi alla lista dei domini"}, 24 | "addsite":{"message":"Aggiungi il domininio corrente alla lista"}, 25 | "addlinksite":{"message":"Aggiungi il domininio del link alla lista"}, 26 | "options":{"message":"Apri le impostazioni"}, 27 | "optionsTitle":{"message":"Copylinks++ opzioni"}, 28 | "tabbutton":{"message":"Azione Pulsante"}, 29 | "tabcontext":{"message":"Menù Constestuale"}, 30 | "tabdomain":{"message":"Lista Domini"}, 31 | "tabregex":{"message":"Lista Regex"}, 32 | "regex":{"message":"Regular Expression"}, 33 | "regexlist":{"message":"Una Regex per linea"}, 34 | "general":{"message":"Generali"}, 35 | "excludepinnedT":{"message":"Schede"}, 36 | "excludepinned":{"message":"Escludi le schede bloccate"}, 37 | "dupliT":{"message":"Link"}, 38 | "dupli":{"message":"Ordina link e rimuovi duplicati"}, 39 | "noti":{"message":"Notifiche abilitate"}, 40 | "notiT":{"message":"Notifiche"} 41 | } -------------------------------------------------------------------------------- /source/img/amo.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 40 | 42 | Created by potrace 1.10, written by Peter Selinger 2001-2011 43 | 44 | 46 | image/svg+xml 47 | 49 | 50 | 51 | 52 | 56 | 61 | 62 | 68 | 69 | -------------------------------------------------------------------------------- /source/img/copylinks.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | image/svg+xml 46 | 48 | 51 | 53 | 55 | 57 | 59 | 62 | 65 | 68 | 71 | 74 | 77 | 80 | 83 | 86 | 89 | 92 | 95 | 98 | 101 | 104 | 107 | 110 | 113 | 116 | 119 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 161 | 164 | 167 | 170 | 173 | 176 | 179 | 182 | 185 | 188 | 191 | 194 | 197 | 200 | 203 | 206 | 209 | 212 | 215 | 216 | 217 | 218 | 219 | 220 | 223 | 228 | 231 | 234 | 237 | 240 | 245 | 250 | 255 | 260 | 265 | 270 | 275 | 280 | 285 | 290 | 295 | 300 | 305 | 310 | 315 | 320 | 325 | 330 | 335 | 340 | 345 | 350 | 355 | 360 | 365 | 370 | 375 | 380 | 385 | 390 | 394 | 399 | 404 | 408 | 413 | 418 | 423 | 428 | 433 | 438 | 443 | 448 | 453 | 458 | 463 | 468 | 473 | 478 | 483 | 488 | 493 | 498 | 499 | 500 | 501 | 502 | 503 | -------------------------------------------------------------------------------- /source/img/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 23 | 32 | 33 | 34 | 59 | 61 | Created by potrace 1.10, written by Peter Selinger 2001-2011 62 | 63 | 65 | image/svg+xml 66 | 68 | 69 | 70 | 71 | 72 | 77 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /source/js/background.js: -------------------------------------------------------------------------------- 1 | //**********************************************************// 2 | //*********************** START ************************// 3 | //**********************************************************// 4 | 5 | //***********************Get Links**************************// 6 | 7 | var getAllLinksOnTab = async(tabId) => { 8 | return new Promise( 9 | (resolve, reject) => { 10 | browser.tabs.executeScript(tabId, { 11 | code: 'getLinksArray();' 12 | }).then(result => { 13 | var linksFromTabArray = result[0]; 14 | allLinksArray = allLinksArray.concat(linksFromTabArray); 15 | resolve(); 16 | }).catch(error => { 17 | resolve(); // The promise has to resolve even if executeScript is rejected because Promise.all fails if any promise is rejected! 18 | }); 19 | }); 20 | }; 21 | 22 | var getAllLinksOnAllTabs = async(tabs) => { 23 | // Creating promises array 24 | var promises = []; 25 | var patternMoz = '^(?!(about:|moz-extension:)).*'; 26 | var regexMoz = new RegExp(patternMoz, 'u'); 27 | numTabs = 0; 28 | 29 | for (var i = 0; i < tabs.length; i++) { 30 | console.log("cbpinned"); 31 | console.log(CBexcludepinned); 32 | console.log("tabpinned"); 33 | console.log(tabs[i].pinned); 34 | console.log("testpinned"); 35 | console.log(!(CBexcludepinned== true && tabs[i].pinned == true)); 36 | console.log("match"); 37 | console.log(addUrls(tabs[i].url, regexMoz)); 38 | if (addUrls(tabs[i].url, regexMoz)) { 39 | if (!(CBexcludepinned== true && tabs[i].pinned == true)) { 40 | console.log("inside pinned"); 41 | 42 | console.log("inside match"); 43 | let prom = await getAllLinksOnTab(tabs[i].id); 44 | promises.push(prom); 45 | numTabs = numTabs + 1; 46 | } 47 | } 48 | } 49 | let p = await Promise.all(promises); 50 | }; 51 | 52 | //***********************Get tab(S)************************// 53 | 54 | const getActiveTab = async() => { 55 | const tab = await browser.tabs.query({ 56 | active: true, 57 | currentWindow: true 58 | }); 59 | return tab; 60 | } 61 | 62 | const getTabsActiveWindow = async() => { 63 | const tabs = await browser.tabs.query({ 64 | currentWindow: true 65 | }); 66 | return tabs; 67 | }; 68 | 69 | const getTabsAllWindows = async() => { 70 | const atabs = await browser.tabs.query({}); 71 | return atabs; 72 | }; 73 | 74 | //****************** Where 2 Copy links ********************// 75 | 76 | const copyAllLinks = async(where2, what2) => { 77 | allLinksArray = []; 78 | var xtabs = []; 79 | switch (where2) { 80 | case 'current': 81 | xtabs = await getActiveTab(); 82 | break; 83 | 84 | case 'alltabs': 85 | xtabs = await getTabsActiveWindow(); 86 | 87 | break; 88 | 89 | case 'alltabsallwindows': 90 | xtabs = await getTabsAllWindows(); 91 | break; 92 | 93 | } 94 | 95 | const tabslinks = await getAllLinksOnAllTabs(xtabs); 96 | copyLinksArrayToClipboard(where2, what2); 97 | console.log(xtabs); 98 | }; 99 | 100 | //******************** APPLY FILTERS *****************// 101 | 102 | var applyfilters = (allLinks, what2) => { 103 | var linksToListed = []; 104 | 105 | //***** include only listed domain ******/ 106 | var filterlistJoined = ARRfilterlist.join('|').replace(/\./g, '\\.').replace(/(\r\n|\n|\r)/gm, ''); 107 | var patternBase = '^((?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:\w+\.)?(?:' + filterlistJoined + ')(?:\/.*)?)'; 108 | 109 | //***** include only magnet ******/ 110 | var patternMag = '^magnet:(?:.+)?(?:\\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40})(?:.+)?' 111 | var patternReg = ARRregexlist.join('|').replace(/(\r\n|\n|\r)/gm, ''); 112 | 113 | //***** remove javascript: ******/ 114 | var patternAll = '^(?!javascript:.*$).*' 115 | switch (what2) { 116 | case 'all': 117 | var pattern = patternAll; 118 | var regex = new RegExp(pattern, 'i'); 119 | break; 120 | case 'torrent': 121 | var pattern = patternMag; 122 | var regex = new RegExp(pattern, 'i'); 123 | break; 124 | case 'listed': 125 | var pattern = patternBase; 126 | var regex = new RegExp(pattern, 'i'); 127 | break; 128 | case 'torrentlisted': 129 | var pattern = '(?:' + patternMag + '|' + patternBase + ')'; 130 | var regex = new RegExp(pattern, 'gim'); 131 | break; 132 | case 'regex': 133 | var pattern = patternReg; 134 | var regex = new RegExp(pattern, 'gim'); 135 | break; 136 | } 137 | 138 | linksToListed = allLinks.filter(linkx => addUrls(linkx, regex)); 139 | return linksToListed; 140 | }; 141 | 142 | // Concatenate with Platform Eol, apply filters and Copy it to clipboard 143 | var copyLinksArrayToClipboard = (where2, what2) => { 144 | // Apply filters 145 | var LinksArray = applyfilters(allLinksArray, what2); 146 | // Remove duplicate, sorting of links 147 | var items = LinksArray; 148 | 149 | if (CBdupli) { 150 | items = [...(new Set(LinksArray))].sort(); 151 | } 152 | var linksText = items.join(EOL); 153 | 154 | var num = items.length; 155 | var notiTitle = browser.i18n.getMessage("notificationTitle") + ' - ' + browser.i18n.getMessage("Numb") + ': ' + num + browser.i18n.getMessage("fromTab") + numTabs + browser.i18n.getMessage("tabs"); 156 | var notiMessage = browser.i18n.getMessage(where2) + '\n' + browser.i18n.getMessage(what2); 157 | 158 | navigator.clipboard.writeText(linksText).then(copiedNotification(notiTitle, notiMessage)); 159 | }; 160 | 161 | // Notification 162 | var copiedNotification = (tit, msg) => { 163 | 164 | if (CBnoti) { 165 | browser.notifications.create('onCopiedNotification', { 166 | "type": "list", 167 | "iconUrl": browser.runtime.getURL("img/copylinks.svg"), 168 | "title": tit, 169 | "message": msg 170 | }); 171 | setTimeout(function () { 172 | browser.notifications.clear('onCopiedNotification'); 173 | }, 3000); 174 | } 175 | } 176 | 177 | // ADD DOMAIN 178 | 179 | var add2list = async() => { 180 | 181 | const tab = await getActiveTab() || {}; 182 | 183 | let matches = tab.url.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/i); 184 | 185 | let domain = m 186 | s && matches[1]; 187 | 188 | let newlist = ARRfilterlist.push(domain); 189 | 190 | var patternZ = '[^\s*$]+'; 191 | var regexZ = new RegExp(patternZ, 'g'); 192 | var itemslist = [...(new Set(ARRfilterlist))].sort(); 193 | var filtered = itemslist.filter(linkz => addUrls(linkz, regexZ)); 194 | 195 | var notiTitle = browser.i18n.getMessage("addsite"); 196 | var notiMessage = domain; 197 | 198 | browser.storage.local.set({ 199 | ARRfilterlist: filtered 200 | }, () => { 201 | copiedNotification(notiTitle, notiMessage); 202 | }); 203 | 204 | }; 205 | 206 | var addlink2list = async(dlink) => { 207 | 208 | let matches = dlink.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/i); 209 | 210 | let domain = matches && matches[1]; 211 | 212 | let newlist = ARRfilterlist.push(domain); 213 | 214 | var patternZ = '[^\s*$]+'; 215 | var regexZ = new RegExp(patternZ, 'g'); 216 | var itemslist = [...(new Set(ARRfilterlist))].sort(); 217 | var filtered = itemslist.filter(linkz => addUrls(linkz, regexZ)); 218 | 219 | var notiTitle = browser.i18n.getMessage("addlinksite"); 220 | var notiMessage = domain; 221 | 222 | browser.storage.local.set({ 223 | ARRfilterlist: filtered 224 | }, () => { 225 | copiedNotification(notiTitle, notiMessage); 226 | }); 227 | }; 228 | 229 | //****************************************************// 230 | //*****Create Conptabs Menu & Button Desc***********// 231 | //****************************************************// 232 | 233 | 234 | var reContextMenu = async() => { 235 | let variables = await setVar(); 236 | /*console.log("recontext");*/ 237 | browser.contextMenus.removeAll(createItems); 238 | }; 239 | 240 | var createItems = async() => { 241 | 242 | /* Button Description */ 243 | var buttonName = browser.i18n.getMessage('appButtonDesc') + '\n' + browser.i18n.getMessage(OPTwhere2copy) + '\n' + browser.i18n.getMessage(OPTwhat2copy); 244 | browser.browserAction.setTitle({ 245 | title: buttonName 246 | }); 247 | 248 | /* Current Tab */ 249 | /* console.log('creation'); */ 250 | if (CBcurrent) { 251 | if (CBall) { 252 | var msgName = browser.i18n.getMessage('current') + ' - ' + browser.i18n.getMessage('all'); 253 | browser.contextMenus.create({ 254 | id: 'clpp-current-all-links', 255 | title: msgName, 256 | contexts: ['page'] 257 | }); 258 | }; 259 | if (CBtorrent) { 260 | var msgName = browser.i18n.getMessage('current') + ' - ' + browser.i18n.getMessage('torrent'); 261 | browser.contextMenus.create({ 262 | id: 'clpp-current-torrent', 263 | title: msgName, 264 | contexts: ['page'] 265 | }); 266 | }; 267 | if (CBlisted) { 268 | var msgName = browser.i18n.getMessage('current') + ' - ' + browser.i18n.getMessage('listed'); 269 | browser.contextMenus.create({ 270 | id: 'clpp-current-listed', 271 | title: msgName, 272 | contexts: ['page'] 273 | }); 274 | }; 275 | if (CBtorrentlisted) { 276 | var msgName = browser.i18n.getMessage('current') + ' - ' + browser.i18n.getMessage('torrentlisted'); 277 | browser.contextMenus.create({ 278 | id: 'clpp-current-torrentlisted', 279 | title: msgName, 280 | contexts: ['page'] 281 | }); 282 | }; 283 | if (CBregex) { 284 | var msgName = browser.i18n.getMessage('current') + ' - ' + browser.i18n.getMessage('regex'); 285 | browser.contextMenus.create({ 286 | id: 'clpp-current-regex', 287 | title: msgName, 288 | contexts: ['page'] 289 | }); 290 | }; 291 | }; 292 | /* Current Window */ 293 | if (CBalltabs) { 294 | if (CBall) { 295 | var msgName = browser.i18n.getMessage('alltabs') + ' - ' + browser.i18n.getMessage('all'); 296 | browser.contextMenus.create({ 297 | id: 'clpp-alltabs-all-links', 298 | title: msgName, 299 | contexts: ['page'] 300 | }); 301 | }; 302 | if (CBtorrent) { 303 | var msgName = browser.i18n.getMessage('alltabs') + ' - ' + browser.i18n.getMessage('torrent'); 304 | browser.contextMenus.create({ 305 | id: 'clpp-alltabs-torrent', 306 | title: msgName, 307 | contexts: ['page'] 308 | }); 309 | }; 310 | if (CBlisted) { 311 | var msgName = browser.i18n.getMessage('alltabs') + ' - ' + browser.i18n.getMessage('listed'); 312 | browser.contextMenus.create({ 313 | id: 'clpp-alltabs-listed', 314 | title: msgName, 315 | contexts: ['page'] 316 | }); 317 | }; 318 | if (CBtorrentlisted) { 319 | var msgName = browser.i18n.getMessage('alltabs') + ' - ' + browser.i18n.getMessage('torrentlisted'); 320 | browser.contextMenus.create({ 321 | id: 'clpp-alltabs-torrentlisted', 322 | title: msgName, 323 | contexts: ['page'] 324 | }); 325 | }; 326 | if (CBregex) { 327 | var msgName = browser.i18n.getMessage('alltabs') + ' - ' + browser.i18n.getMessage('regex'); 328 | browser.contextMenus.create({ 329 | id: 'clpp-alltabs-regex', 330 | title: msgName, 331 | contexts: ['page'] 332 | }); 333 | }; 334 | }; 335 | /* All Windows */ 336 | if (CBalltabsallwindows) { 337 | if (CBall) { 338 | var msgName = browser.i18n.getMessage('alltabsallwindows') + ' - ' + browser.i18n.getMessage('all'); 339 | browser.contextMenus.create({ 340 | id: 'clpp-alltabsallwindows-all-links', 341 | title: msgName, 342 | contexts: ['page'] 343 | }); 344 | }; 345 | if (CBtorrent) { 346 | var msgName = browser.i18n.getMessage('alltabsallwindows') + ' - ' + browser.i18n.getMessage('torrent'); 347 | browser.contextMenus.create({ 348 | id: 'clpp-alltabsallwindows-torrent', 349 | title: msgName, 350 | contexts: ['page'] 351 | }); 352 | }; 353 | if (CBlisted) { 354 | var msgName = browser.i18n.getMessage('alltabsallwindows') + ' - ' + browser.i18n.getMessage('listed'); 355 | browser.contextMenus.create({ 356 | id: 'clpp-alltabsallwindows-listed', 357 | title: msgName, 358 | contexts: ['page'] 359 | }); 360 | }; 361 | if (CBtorrentlisted) { 362 | var msgName = browser.i18n.getMessage('alltabsallwindows') + ' - ' + browser.i18n.getMessage('torrentlisted'); 363 | browser.contextMenus.create({ 364 | id: 'clpp-alltabsallwindows-torrentlisted', 365 | title: msgName, 366 | contexts: ['page'] 367 | }); 368 | }; 369 | if (CBregex) { 370 | var msgName = browser.i18n.getMessage('alltabsallwindows') + ' - ' + browser.i18n.getMessage('regex'); 371 | browser.contextMenus.create({ 372 | id: 'clpp-alltabsallwindows-regex', 373 | title: msgName, 374 | contexts: ['page'] 375 | }); 376 | }; 377 | 378 | }; 379 | /* Add current domain to list */ 380 | if (CBaddsite) { 381 | var msgName = browser.i18n.getMessage('addsite'); 382 | browser.contextMenus.create({ 383 | id: 'clpp-addsite', 384 | title: msgName, 385 | contexts: ['page'] 386 | }); 387 | }; 388 | /* Add link domain to list */ 389 | if (CBaddlinksite) { 390 | var msgName = browser.i18n.getMessage('addlinksite'); 391 | browser.contextMenus.create({ 392 | id: 'clpp-addlinksite', 393 | title: msgName, 394 | contexts: ['link'] 395 | }); 396 | }; 397 | /* Option */ 398 | var msgName = browser.i18n.getMessage('options'); 399 | browser.contextMenus.create({ 400 | id: 'clpp-options', 401 | title: msgName, 402 | icons: { 403 | 16: "img/copylinks.svg", 404 | 32: "img/copylinks.svg" 405 | }, 406 | contexts: ["page_action", "browser_action"] 407 | }); 408 | 409 | }; 410 | 411 | /* Context menu onClicked event listener */ 412 | browser.contextMenus.onClicked.addListener((info, tab) => { 413 | switch (info.menuItemId) { 414 | case 'clpp-current-all-links': 415 | copyAllLinks('current', 'all'); 416 | break; 417 | case 'clpp-current-torrent': 418 | copyAllLinks('current', 'torrent'); 419 | break; 420 | case 'clpp-current-listed': 421 | copyAllLinks('current', 'listed'); 422 | break; 423 | case 'clpp-current-torrentlisted': 424 | copyAllLinks('current', 'torrentlisted'); 425 | break; 426 | case 'clpp-current-regex': 427 | copyAllLinks('current', 'regex'); 428 | break; 429 | case 'clpp-alltabs-all-links': 430 | copyAllLinks('alltabs', 'all'); 431 | break; 432 | case 'clpp-alltabs-torrent': 433 | copyAllLinks('alltabs', 'torrent'); 434 | break; 435 | case 'clpp-alltabs-listed': 436 | copyAllLinks('alltabs', 'listed'); 437 | break; 438 | case 'clpp-alltabs-torrentlisted': 439 | copyAllLinks('alltabs', 'torrentlisted'); 440 | break; 441 | case 'clpp-alltabs-regex': 442 | copyAllLinks('alltabs', 'regex'); 443 | break; 444 | case 'clpp-alltabsallwindows-all-links': 445 | copyAllLinks('alltabsallwindows', 'all'); 446 | break; 447 | case 'clpp-alltabsallwindows-torrent': 448 | copyAllLinks('alltabsallwindows', 'torrent'); 449 | break; 450 | case 'clpp-alltabsallwindows-listed': 451 | copyAllLinks('alltabsallwindows', 'listed'); 452 | break; 453 | case 'clpp-alltabsallwindows-torrentlisted': 454 | copyAllLinks('alltabsallwindows', 'torrentlisted'); 455 | break; 456 | case 'clpp-alltabsallwindows-regex': 457 | copyAllLinks('alltabsallwindows', 'regex'); 458 | break; 459 | case 'clpp-addsite': 460 | add2list(); 461 | break; 462 | case 'clpp-addlinksite': 463 | addlink2list(info.linkUrl); 464 | break; 465 | case 'clpp-options': 466 | browser.runtime.openOptionsPage(); 467 | break; 468 | } 469 | }); 470 | 471 | //****************************************************// 472 | //*************** Button Action **********************// 473 | //****************************************************// 474 | 475 | 476 | var actionStart = () => { 477 | copyAllLinks(OPTwhere2copy, OPTwhat2copy); 478 | }; 479 | 480 | var initializeAddon = async() => { 481 | 482 | let init = await inidef(); 483 | let reContext = await reContextMenu(); 484 | browser.storage.onChanged.addListener(reContextMenu); 485 | browser.browserAction.onClicked.addListener(actionStart); 486 | browser.commands.onCommand.addListener(function (command) { 487 | if (command == "quickAction") { 488 | actionStart(); 489 | } 490 | }); 491 | }; 492 | 493 | initializeAddon(); 494 | -------------------------------------------------------------------------------- /source/js/common.js: -------------------------------------------------------------------------------- 1 | //*********************** VARIABLES ***********************// 2 | 3 | var allLinksArray = []; 4 | var bbtt; 5 | 6 | var url = ''; 7 | var re; 8 | 9 | var numTabs = 0; 10 | var where2copy; 11 | var what2copy; 12 | 13 | ///**** SETTING VARIABLES *****/// 14 | var OPTwhere2copy; 15 | var OPTwhat2copy; 16 | var ARRfilterlist; 17 | var ARRregexlist; 18 | var CBall; 19 | var CBtorrent; 20 | var CBlisted; 21 | var CBtorrentlisted; 22 | var CBregex; 23 | var CBcurrent; 24 | var CBalltabs; 25 | var CBalltabsallwindows; 26 | var CBaddsite; 27 | var CBaddlinksite; 28 | var CBexcludepinned; 29 | var CBdupli; 30 | var CBnoti; 31 | var EOL; 32 | ///**** END SETTINGS*****/// 33 | 34 | const dList = ['vk.com/doc', 'free.fr', 'katfile.com', 'nitroflare.com', '1fichier.com', 'clicknupload.org', 'dailyuploads.net', 'bdupload.in', 'dindishare.in', 'jheberg.net', 'filerio.in', 'go4up.com', 'hil.to', 'letsupload.co', 'mega.nz', 'megaup.net', 'mirrorace.com', 'multiup.org', 'openload.co', 'qfiles.io', 'rapidgator.net', 'sendit.cloud', 'turbo.to', 'tusfiles.com', 'uploadhaven.com', 'uptobox.com', 'userscloud.com', 'filesupload.org', 'zippyshare.com']; 35 | const rList = ["^(http|https)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.(it)(\\/\\S*)?/"]; 36 | 37 | const getSetting = async() => { 38 | const dsetting = await browser.storage.local.get({ 39 | // Default Settings 40 | OPTwhere2copy: 'current', 41 | OPTwhat2copy: 'all', 42 | ARRfilterlist: dList, 43 | ARRregexlist: rList, 44 | CBall: true, 45 | CBtorrent: true, 46 | CBlisted: true, 47 | CBtorrentlisted: false, 48 | CBregex: false, 49 | CBcurrent: true, 50 | CBalltabs: true, 51 | CBalltabsallwindows: false, 52 | CBaddsite: true, 53 | CBaddlinksite: true, 54 | CBdupli: true, 55 | CBexcludepinned: true, 56 | CBnoti: true, 57 | EOL: '\n' 58 | }); 59 | return dsetting; 60 | } 61 | 62 | const setVar = async() => { 63 | const setting = await getSetting(); 64 | OPTwhere2copy = setting.OPTwhere2copy; 65 | OPTwhat2copy = setting.OPTwhat2copy; 66 | ARRfilterlist = setting.ARRfilterlist; 67 | ARRregexlist = setting.ARRregexlist; 68 | CBall = setting.CBall; 69 | CBtorrent = setting.CBtorrent; 70 | CBlisted = setting.CBlisted; 71 | CBtorrentlisted = setting.CBtorrentlisted; 72 | CBregex = setting.CBregex; 73 | CBcurrent = setting.CBcurrent; 74 | CBalltabs = setting.CBalltabs; 75 | CBalltabsallwindows = setting.CBalltabsallwindows; 76 | CBaddsite = setting.CBaddsite; 77 | CBaddlinksite = setting.CBaddlinksite; 78 | CBdupli = setting.CBdupli; 79 | CBexcludepinned = setting.CBexcludepinned; 80 | CBnoti = setting.CBnoti; 81 | EOL = setting.EOL; 82 | } 83 | 84 | const getEol = async() => { 85 | const info = await browser.runtime.getPlatformInfo(); 86 | var os = info.os; 87 | var platformEol; 88 | switch (os) { 89 | case 'mac': 90 | platformEol = '\r'; 91 | break; 92 | case 'win': 93 | platformEol = '\r\n'; 94 | break; 95 | case 'android': 96 | case 'cros': 97 | case 'linux': 98 | case 'openbsd': 99 | platformEol = '\n'; 100 | break; 101 | }; 102 | return platformEol; 103 | } 104 | 105 | const inidef = async() => { 106 | const setting = await getSetting(); 107 | const myVar = await setVar(); 108 | const osEol = await getEol(); 109 | browser.storage.local.set({ 110 | OPTwhere2copy: setting.OPTwhere2copy, 111 | OPTwhat2copy: setting.OPTwhat2copy, 112 | CBall: setting.CBall, 113 | CBtorrent: setting.CBtorrent, 114 | CBlisted: setting.CBlisted, 115 | CBtorrentlisted: setting.CBtorrentlisted, 116 | CBregex: setting.CBregex, 117 | CBcurrent: setting.CBcurrent, 118 | CBalltabs: setting.CBalltabs, 119 | CBalltabsallwindows: setting.CBalltabsallwindows, 120 | CBaddsite: setting.CBaddsite, 121 | CBaddlinksite: setting.CBaddlinksite, 122 | CBexcludepinned: setting.CBexcludepinned, 123 | CBdupli: setting.CBdupli, 124 | CBnoti: setting.CBnoti, 125 | ARRfilterlist: setting.ARRfilterlist, 126 | ARRregexlist: setting.ARRregexlist, 127 | EOL: osEol 128 | }, () => { 129 | /* console.log('inisaved' + platformEol +'!!!'); */ 130 | }); 131 | }; 132 | 133 | // match regex 134 | 135 | var addUrls = (url, re) => { 136 | if (!url.match(re)) 137 | return false; 138 | return true; 139 | }; 140 | 141 | // Localization 142 | var localization = () => { 143 | document.querySelectorAll('[data-i18n]') 144 | .forEach((node) => { 145 | node.textContent = browser.i18n.getMessage(node.dataset.i18n); 146 | }); 147 | } 148 | -------------------------------------------------------------------------------- /source/js/content-script.js: -------------------------------------------------------------------------------- 1 | //*********************** CONTENT SCRIPT **********************// 2 | 3 | var anchorsArrayToTextArray = anchors => { 4 | var links = []; 5 | for (var i = 0; i < anchors.length; i++) { 6 | var anchor = anchors[i]; 7 | if (anchor.href !== undefined && anchor.href !== '') links.push(anchor.href); 8 | } 9 | return links; 10 | }; 11 | 12 | var getLinksArray = () => { 13 | var anchors = document.getElementsByTagName('a'); 14 | var linksArray = anchorsArrayToTextArray(anchors); 15 | return linksArray; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /source/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifest_version": 2, 3 | "name": "__MSG_appName__", 4 | "version": "2.3.0", 5 | "description": "__MSG_appDesc__", 6 | "default_locale": "en_US", 7 | "applications": { 8 | "gecko": { 9 | "id": "@copylinksplusplus", 10 | "strict_min_version": "63.0" 11 | } 12 | }, 13 | 14 | "icons": { 15 | "48": "img/copylinks.svg", 16 | "96": "img/copylinks.svg" 17 | }, 18 | 19 | "permissions": [ 20 | "", 21 | "activeTab", 22 | "tabs", 23 | "contextMenus", 24 | "clipboardWrite", 25 | "storage", 26 | "notifications" 27 | ], 28 | "browser_action": { 29 | "browser_style": true, 30 | "default_icon": { 31 | "38": "img/copylinks.svg", 32 | "19": "img/copylinks.svg" 33 | }, 34 | "default_title": "__MSG_appButtonDesc__" 35 | }, 36 | "commands": { 37 | "quickAction": { 38 | "description": "__MSG_quickAction__", 39 | "suggested_key": { 40 | "default": "Alt+Z" 41 | } 42 | } 43 | }, 44 | "content_scripts": [{ 45 | "matches": ["*://*/*"], 46 | "js": ["js/content-script.js"] 47 | } 48 | ], 49 | 50 | "background": { 51 | "scripts": [ 52 | "js/common.js", 53 | "js/background.js" 54 | ] 55 | }, 56 | 57 | "options_ui": { 58 | "browser_style": true, 59 | "page": "options/options.html", 60 | "open_in_tab": true 61 | } 62 | } -------------------------------------------------------------------------------- /source/options/options.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | margin: 0; 4 | overflow: hidden; 5 | background: #ffffff; 6 | } 7 | 8 | body { 9 | width: 1200px; 10 | background: #f0f0f0; 11 | font-family: sans-serif; 12 | font-size: 14px; 13 | height: calc(100% - 2px); 14 | margin: 0 auto; 15 | padding: 0; 16 | border-color: #c70007; 17 | border-width: 1px; 18 | border-style: solid; 19 | } 20 | 21 | .container { 22 | width: 100%; 23 | height: 100%; 24 | } 25 | 26 | /* Tabbed Area */ 27 | 28 | .tabbed-area { 29 | background: #f0f0f0; 30 | width: 100%; 31 | height: 100%; 32 | position: relative; 33 | } 34 | 35 | .logo { 36 | background: #bebebe; 37 | width: 160px; 38 | height: 160px; 39 | } 40 | 41 | .logo div { 42 | width: 130px; 43 | height: 130px; 44 | border-radius: 50%; 45 | background: #f0f0f0; 46 | overflow: hidden; 47 | position: relative; 48 | top: 15px; 49 | left: 15px; 50 | } 51 | 52 | .logo div img { 53 | width: 100px; 54 | height: 100px; 55 | margin: 0; 56 | position: absolute; 57 | top: 50%; 58 | left: 50%; 59 | transform: translate(-50%, -50%); 60 | } 61 | 62 | .tabbed-area > input { 63 | position: absolute; 64 | filter: alpha(opacity=0); 65 | opacity: 0; 66 | } 67 | 68 | .tabbed-area > input + span, 69 | .tabbed-area > input:hover + span, 70 | .tabbed-area > input:checked + span { 71 | font-family: sans-serif; 72 | font-weight: bold; 73 | font-size: 14px; 74 | } 75 | 76 | .tabbed-area > input:hover { 77 | cursor: pointer; 78 | } 79 | 80 | .tabbed-area > input:hover + span, 81 | .tabbed-area > input:checked + span { 82 | background: #f0f0f0; 83 | color:#c70007; 84 | } 85 | .tabbed-area > input:checked + span + i { 86 | color: #c70007; 87 | } 88 | 89 | .tabbed-area > i { 90 | position: absolute; 91 | margin-top: -40px; 92 | padding: 0 20px; 93 | font-size: 20px; 94 | } 95 | 96 | .tabbed-area > span, 97 | .tabbed-area > i { 98 | transition: all .5s; 99 | } 100 | 101 | .tabbed-area > input, 102 | .tabbed-area > span { 103 | background: #bebebe; 104 | display: block; 105 | width: 160px; 106 | height: 60px; 107 | line-height: 60px; 108 | text-align: center; 109 | z-index: 9; 110 | } 111 | .tabbed-area > .last { 112 | height: 30px; 113 | border-radius: 0px 0px 50px; 114 | } 115 | 116 | 117 | .top-bar { 118 | background: #bebebe; 119 | color: #000; 120 | position: absolute; 121 | top: 0; 122 | right: 0; 123 | width: calc(100% - 160px); 124 | height: 60px; 125 | line-height: 60px; 126 | list-style-type: none; 127 | z-index: 9; 128 | } 129 | .top-bar ul, 130 | .top-bar li { 131 | margin-top: 0px; 132 | padding-top: 0px; 133 | float: right; 134 | list-style: none; 135 | } 136 | 137 | .top-bar a { 138 | display: block; 139 | padding: 0 20px; 140 | transition: all .5s; 141 | } 142 | 143 | .top-bar li:hover { 144 | background: #f0f0f0; 145 | } 146 | .top-bar a img { 147 | width: 32px; 148 | height: 32px; 149 | vertical-align: middle; 150 | } 151 | 152 | .tab-content { 153 | position: absolute; 154 | top: 0; 155 | right: 0; 156 | width: calc(100% - 160px); 157 | height: 100%; 158 | padding-top: 60px; 159 | } 160 | 161 | .tab-content section { 162 | position: absolute; 163 | width: calc(100% - 10px); 164 | height: 100%; 165 | padding: 10px; 166 | display: none; 167 | overflow: visible; 168 | } 169 | 170 | .tabbed-area > input.tab-0:checked ~ .tab-content .tab-item-0 { 171 | display: block; 172 | } 173 | 174 | .tabbed-area > input.tab-1:checked ~ .tab-content .tab-item-1 { 175 | display: block; 176 | } 177 | 178 | .tabbed-area > input.tab-2:checked ~ .tab-content .tab-item-2 { 179 | display: block; 180 | } 181 | 182 | .tabbed-area > input.tab-3:checked ~ .tab-content .tab-item-3 { 183 | display: block; 184 | } 185 | 186 | .tabbed-area > input.tab-4:checked ~ .tab-content .tab-item-4 { 187 | display: block; 188 | } 189 | 190 | 191 | /***************************************************/ 192 | .half{ 193 | margin: 8px 10px 8px 10px; 194 | padding: 0px 10px 0px 10px; 195 | width: calc(50% - 40px); 196 | } 197 | 198 | .full{ 199 | margin: 8px 10px 8px 10px; 200 | padding: 0px 10px 0px 10px; 201 | width: calc(100% - 40px); 202 | } 203 | 204 | 205 | legend { 206 | margin: 2px 8px 2px 8px; 207 | font-family: sans-serif; 208 | font-size: 90%; 209 | color: #e5e5e5; 210 | font-weight: bold; 211 | background: #000; 212 | padding: 0.2em 0.5em; 213 | border-radius: 4px; 214 | } 215 | 216 | h1 { 217 | font-family: sans-serif; 218 | font-weight: bold; 219 | font-size: 14px; 220 | margin-top: 0; 221 | margin-bottom: 0; 222 | text-transform: uppercase; 223 | } 224 | 225 | .control-group-big { 226 | display: block; 227 | vertical-align: top; 228 | background: #fff; 229 | text-align: left; 230 | border: 1px solid #969696; 231 | box-shadow: 4px 4px 4px rgba(0,0,0,0.75); 232 | padding: 3px; 233 | width: calc(100% - 18px); 234 | margin: 10px 6px 10px 6px; 235 | } 236 | 237 | /* Select Boxes */ 238 | 239 | .select { 240 | position: relative; 241 | display: inline-block; 242 | width: calc(100% - 10px); 243 | border: 1px solid #969696; 244 | box-shadow: 4px 4px 4px rgba(0,0,0,0.75); 245 | margin: 5px; 246 | padding: 0px; 247 | } 248 | 249 | .select select { 250 | display: inline-block; 251 | width: 100%; 252 | cursor: pointer; 253 | padding: 10px 15px; 254 | outline: 0; 255 | border: 0; 256 | border-radius: 0; 257 | background: #e5e5e5; 258 | color: #000; 259 | appearance: none; 260 | -moz-appearance: none; 261 | } 262 | .select select::-ms-expand { 263 | display: none; 264 | } 265 | 266 | .select select:hover, 267 | .select select:focus { 268 | color: #000; 269 | background: #e5e5e5; 270 | } 271 | .select select:disabled { 272 | opacity: 0.5; 273 | pointer-events: none; 274 | } 275 | .select__arrow { 276 | position: absolute; 277 | top: 16px; 278 | right: 15px; 279 | width: 0; 280 | height: 0; 281 | pointer-events: none; 282 | border-style: solid; 283 | border-width: 8px 5px 0 5px; 284 | border-color: #7b7b7b transparent transparent transparent; 285 | } 286 | .select select:hover ~ .select__arrow, 287 | .select select:focus ~ .select__arrow { 288 | border-top-color: #000; 289 | } 290 | .select select:disabled ~ .select__arrow { 291 | border-top-color: #ccc; 292 | } 293 | .select select, 294 | .select option { 295 | font-size: 14px; 296 | } 297 | 298 | 299 | /* Text Area */ 300 | 301 | .notes { 302 | background-image: linear-gradient(#e5e5e5, #e5e5e5 23px, #ccc 23px, #ccc 23px, white 23px); 303 | background-size: 100% 24px; 304 | background-attachment: local; 305 | border: 1px solid #ccc; 306 | border-radius: 8px; 307 | box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); 308 | line-height: 24px; 309 | font-size: 16px; 310 | scrollbar-width: none; 311 | resize: none; 312 | color: #000; 313 | padding: 0px 10px 0px 10px; 314 | } 315 | 316 | textarea { 317 | padding: 10px; 318 | margin: 10px; 319 | height: 420px; 320 | width: calc(100% - 40px); 321 | } 322 | 323 | 324 | /* Check Boxes */ 325 | 326 | .cbcontainer { 327 | display: block; 328 | } 329 | 330 | .cbcontrol-group { 331 | display: block; 332 | vertical-align: top; 333 | background: #e5e5e5; 334 | text-align: left; 335 | border: 1px solid #969696; 336 | box-shadow: 4px 4px 4px rgba(0,0,0,0.75); 337 | width: calc(100% - 10px); 338 | margin: 5px; 339 | padding: 0px; 340 | } 341 | 342 | .cbcontrol { 343 | display: block; 344 | position: relative; 345 | cursor: pointer; 346 | } 347 | 348 | .cbspan { 349 | font-size: 16px; 350 | } 351 | 352 | input[type="checkbox"] { 353 | margin:8px; 354 | position:relative; 355 | vertical-align:middle; 356 | width:60px; 357 | height:20px; 358 | -moz-appearance: none; 359 | background: linear-gradient(0deg, #ed1d0c, #fd5143); 360 | outline: none; 361 | border-radius: 15px; 362 | box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1); 363 | } 364 | 365 | input:checked[type="checkbox"] { 366 | background: linear-gradient(0deg, #b6f7a6 , #bebebe); 367 | box-shadow: 0 0 0 4px #353535, 0 0 0 5px #3e3e3e, inset 0 0 10px rgba(0,0,0,1); 368 | } 369 | 370 | input[type="checkbox"]:before { 371 | content:''; 372 | position:absolute; 373 | top:0; 374 | left:0; 375 | width:40px; 376 | height:20px; 377 | background: linear-gradient(0deg, #000, #6b6b6b); 378 | border-radius: 12px; 379 | box-shadow: 0 0 0 1px #232323; 380 | transform: scale(.98,.96); 381 | transition:.5s; 382 | } 383 | 384 | input:checked[type="checkbox"]:before { 385 | left:20px; 386 | } 387 | 388 | input[type="checkbox"]:after{ 389 | content:''; 390 | position:absolute; 391 | top:calc(50% - 2px); 392 | left: 28px; 393 | width:4px; 394 | height:4px; 395 | background: linear-gradient(0deg, #6b6b6b, #000); 396 | border-radius: 50%; 397 | transition:.5s; 398 | } 399 | 400 | input:checked[type="checkbox"]:after { 401 | left:48px; 402 | } 403 | -------------------------------------------------------------------------------- /source/options/options.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
42 | 54 |
55 | 56 | 57 |
58 |
59 |
60 | 61 |
62 |

63 |
64 | 69 |
70 |
71 |
72 |
73 |

74 |
75 | 82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | 90 |
91 |

92 |
93 |
94 | 98 | 102 | 106 |
107 |
108 |
109 |
110 |

111 |
112 |
113 | 117 | 121 | 125 | 129 | 133 |
134 |
135 |
136 |
137 |

138 |
139 |
140 | 144 | 148 |
149 |
150 |
151 |
152 | 153 |
154 |
155 |
156 | 157 |
158 |

159 |
160 | 161 |
162 |
163 |
164 |
165 |
166 |
167 | 168 |
169 |

170 |
171 | 172 |
173 |
174 |
175 |
176 |
177 |
178 | 179 |
180 |

181 |
182 |
183 | 187 |
188 |
189 |
190 |
191 |
192 | 193 |
194 |

195 |
196 |
197 | 201 |
202 |
203 |
204 |
205 |
206 | 207 |
208 |

209 |
210 |
211 | 215 |
216 |
217 |
218 |
219 |
220 | 221 |
222 | 223 |
224 |
225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /source/options/options.js: -------------------------------------------------------------------------------- 1 | // Run when page loads 2 | window.onload = () => { 3 | 4 | // Settings 5 | updateUI(); 6 | // Update Settings 7 | document.getElementById('OPTwhere2copy').onchange = () => { 8 | saveSettings(); 9 | }; 10 | document.getElementById('OPTwhat2copy').onchange = () => { 11 | saveSettings(); 12 | }; 13 | document.getElementById('CBall').onchange = () => { 14 | saveSettings(); 15 | }; 16 | document.getElementById('CBtorrent').onchange = () => { 17 | saveSettings(); 18 | }; 19 | document.getElementById('CBlisted').onchange = () => { 20 | saveSettings(); 21 | }; 22 | document.getElementById('CBtorrentlisted').onchange = () => { 23 | saveSettings(); 24 | }; 25 | document.getElementById('CBregex').onchange = () => { 26 | saveSettings(); 27 | }; 28 | document.getElementById('CBcurrent').onchange = () => { 29 | saveSettings(); 30 | }; 31 | document.getElementById('CBalltabs').onchange = () => { 32 | saveSettings(); 33 | }; 34 | document.getElementById('CBalltabsallwindows').onchange = () => { 35 | saveSettings(); 36 | }; 37 | document.getElementById('CBaddsite').onchange = () => { 38 | saveSettings(); 39 | }; 40 | document.getElementById('CBaddlinksite').onchange = () => { 41 | saveSettings(); 42 | }; 43 | document.getElementById('TXTdomainlist').onchange = () => { 44 | saveSettings(); 45 | }; 46 | document.getElementById('TXTregexlist').onchange = () => { 47 | saveSettings(); 48 | }; 49 | document.getElementById('CBdupli').onchange = () => { 50 | saveSettings(); 51 | }; 52 | document.getElementById('CBexcludepinned').onchange = () => { 53 | saveSettings(); 54 | }; 55 | document.getElementById('CBnoti').onchange = () => { 56 | saveSettings(); 57 | }; 58 | browser.storage.onChanged.addListener(updateUI); 59 | // Localization 60 | localization(); 61 | } 62 | // Load Settings 63 | var updateUI = async () => { 64 | const setting = await getSetting(); 65 | // Eol 66 | var EOL = setting.EOL; 67 | 68 | // Update GUI 69 | document.getElementById('OPTwhere2copy').value = setting.OPTwhere2copy; 70 | document.getElementById('OPTwhat2copy').value = setting.OPTwhat2copy; 71 | document.getElementById('CBall').checked = setting.CBall; 72 | document.getElementById('CBtorrent').checked = setting.CBtorrent; 73 | document.getElementById('CBlisted').checked = setting.CBlisted; 74 | document.getElementById('CBtorrentlisted').checked = setting.CBtorrentlisted; 75 | document.getElementById('CBregex').checked = setting.CBregex; 76 | document.getElementById('CBcurrent').checked = setting.CBcurrent; 77 | document.getElementById('CBalltabs').checked = setting.CBalltabs; 78 | document.getElementById('CBalltabsallwindows').checked = setting.CBalltabsallwindows; 79 | document.getElementById('CBaddsite').checked = setting.CBaddsite; 80 | document.getElementById('CBaddlinksite').checked = setting.CBaddlinksite; 81 | document.getElementById('TXTdomainlist').value = setting.ARRfilterlist.join(EOL); 82 | document.getElementById('TXTregexlist').value = setting.ARRregexlist.join(EOL); 83 | document.getElementById('CBdupli').checked = setting.CBdupli; 84 | document.getElementById('CBexcludepinned').checked = setting.CBexcludepinned; 85 | document.getElementById('CBnoti').checked = setting.CBnoti; 86 | 87 | }; 88 | // Save Settings 89 | var saveSettings = () => { 90 | /* console.log("saving");*/ 91 | var domlist = document.getElementById('TXTdomainlist').value.replace(/\r\n/g, '\n').split('\n'); 92 | var reglist = document.getElementById('TXTregexlist').value.replace(/\r\n/g, '\n').split('\n'); 93 | 94 | var patternZ = '[^\s*$]+'; 95 | var regexZ = new RegExp(patternZ, 'g'); 96 | 97 | var domitems = [...(new Set(domlist))].sort(); 98 | var domfiltered = domitems.filter(linkz => addUrls(linkz, regexZ)); 99 | 100 | var regitems = [...(new Set(reglist))].sort(); 101 | var regfiltered = regitems.filter(regz => addUrls(regz, regexZ)); 102 | 103 | 104 | browser.storage.local.set({ 105 | OPTwhere2copy: document.getElementById('OPTwhere2copy').value, 106 | OPTwhat2copy: document.getElementById('OPTwhat2copy').value, 107 | CBall: document.getElementById('CBall').checked, 108 | CBtorrent: document.getElementById('CBtorrent').checked, 109 | CBlisted: document.getElementById('CBlisted').checked, 110 | CBtorrentlisted: document.getElementById('CBtorrentlisted').checked, 111 | CBregex: document.getElementById('CBregex').checked, 112 | CBcurrent: document.getElementById('CBcurrent').checked, 113 | CBalltabs: document.getElementById('CBalltabs').checked, 114 | CBalltabsallwindows: document.getElementById('CBalltabsallwindows').checked, 115 | CBaddsite: document.getElementById('CBaddsite').checked, 116 | CBaddlinksite: document.getElementById('CBaddlinksite').checked, 117 | CBdupli: document.getElementById('CBdupli').checked, 118 | CBexcludepinned: document.getElementById('CBexcludepinned').checked, 119 | CBnoti: document.getElementById('CBnoti').checked, 120 | ARRfilterlist: domfiltered, 121 | ARRregexlist: regfiltered 122 | }, () => { 123 | /*console.log('saved');*/ 124 | }); 125 | }; 126 | --------------------------------------------------------------------------------