Knowledge (XXG)

User:Alexis Jazz/AJSJSMangler

Source 📝

37:
AJSJSMangler also has some options for whitespace removal. Compared to UglifyJS, AJSJSMangler is somewhat less efficient in that department. It's not too far off, for Bawl UglifyJS only shaves off another 7%. When used on its own (without AJSJSMangler's key mangling), UglifyJS performs much worse
29:
AJSJSMangler is a script that can mangle userscripts to make them smaller. Specifically object keys, which UglifyJS won't touch as far as I could tell. It can be used in addition to a minifier. Frankly it was just written to minify
38:
than AJSJSMangler for Bawl. AJSJSMangler is more likely to introduce problems as it hasn't been tested nearly as well as UglifyJS. On the other hand: AJSJSMangler doesn't necessarily make
56:) If you can't do that, this script is not for you. DO NOT PUT IN COMMON.JS. Paste your script, mangle it, then process it with a regular minifier like minJS or UglifyJS. (online demo: 167:
ZERO CHECKS IF THIS BREAKS YOUR SCRIPT. IF YOU FOLLOWED THE RULES AND ALL THE STARS ALIGN IT SHOULDN'T. PROBABLY. YMMV. PROVIDED AS IS. DO NOT BLINDLY APPLY THIS TO YOUR SCRIPTS.
160:
Only myScriptsMainVariableName.someNameToBeMangled gets mangled. In myScriptsMainVariableName.someNameToBeMangled.someObject, "someObject" is SAFE from mangling.
590: 624: 53: 50:
mw.loader.load('//en.wikipedia.org/search/?title=User:Alexis_Jazz/AJSJSMangler.js&action=raw&ctype=text/javascript');
64:
The first occurrence of "window.myScriptsMainVariableName = {};" will be assumed to be the main variable of your script.
31: 26:
Is it "A JS JS mangler" (A JavaScript Mangler written in JavaScript) or AJ's JavaScript Mangler?
17: 42:
cry. The highest compression is achieved by using AJSJSMangler followed by UglifyJS.
92:'<a onclick="myScript.doSomething()">Do something</a>' 163:
Any line that contains myScriptsMainVariableName.debug gets removed entirely.
70:
If keys appear in strings anywhere you have a problem. Instead of writing
67:
This variable and its contents CANNOT be shared with other script files.
57: 39: 45:
If you didn't get the message yet, NO, this is not a polished tool!
34:
more effectively. Will it work for your scripts too? Nobody knows
8: 148:'()">Do something</a>' 594: 121:'<a onclick="myScript.' 58:https://lisperator.net/uglifyjs/#demo 7: 24: 1: 171:YOU DO NOT TALK ABOUT wait no 157:Put ALL your crap in there! 664: 418: 177: 100: 71: 109:'#firstHeading' 80:'#firstHeading' 469:'Content text' 228:'Content text' 52:from the JS console. ( 99:you'll have to write 32:User:Alexis Jazz/Bawl 586:Go mangle yourself 651: 650: 655: 616:AJSJSM+UglifyJS 595: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 541:'format' 539: 536: 533: 530: 529:'action' 527: 524: 521: 518: 515: 512: 509: 506: 503: 502:'format' 500: 497: 494: 491: 490:'action' 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 363://myScript.debug 361: 358: 357://myScript.debug 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 300:'format' 298: 295: 292: 289: 288:'action' 286: 283: 280: 277: 274: 271: 268: 265: 262: 261:'format' 259: 256: 253: 250: 249:'action' 247: 244: 241: 238: 235: 232: 229: 226: 223: 220: 217: 214: 211: 208: 205: 202: 199: 196: 193: 190: 187: 184: 181: 152: 149: 146: 143: 140: 137: 134: 131: 128: 125: 122: 119: 116: 113: 110: 107: 104: 96: 93: 90: 87: 84: 81: 78: 75: 51: 18:User:Alexis Jazz 663: 662: 658: 657: 656: 654: 653: 652: 625:AJSJSMangler.js 588: 583: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 535:'parse' 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 414: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 347: 344: 341: 338: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 294:'parse' 293: 290: 287: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 154: 153: 150: 147: 144: 141: 138: 135: 132: 129: 126: 123: 120: 117: 114: 111: 108: 105: 102: 98: 97: 94: 91: 88: 85: 82: 79: 76: 73: 49: 22: 21: 20: 12: 11: 5: 661: 659: 649: 648: 645: 642: 639: 636: 633: 630: 627: 621: 620: 617: 614: 611: 608: 607:% or original 605: 602: 601:Original size 599: 598:Source script 587: 584: 547:'json' 508:'json' 496:'edit' 419: 408:'done' 306:'json' 267:'json' 255:'edit' 178: 173: 172: 169: 164: 161: 158: 155: 101: 72: 68: 65: 23: 15: 14: 13: 10: 9: 6: 4: 3: 2: 660: 646: 643: 640: 637: 634: 631: 629:21,486 bytes 628: 626: 623: 622: 619:%of original 618: 615: 613:%of original 612: 609: 606: 603: 600: 597: 596: 593: 592: 585: 417: 279:paramsPreview 176: 170: 168: 165: 162: 159: 156: 69: 66: 63: 62: 61: 59: 55: 46: 43: 41: 35: 33: 27: 19: 589: 415: 174: 166: 47: 44: 36: 28: 25: 591:No problem. 48:Usage: run 610:UglifyJS 416:Becomes: 175:Example: 60:) Rules: 571:myScript 553:myScript 514:myScript 475:myScript 457:myScript 451:myScript 439:myScript 427:myScript 396:myScript 384:myScript 366:myScript 324:function 312:myScript 273:myScript 234:myScript 216:myScript 210:myScript 198:myScript 186:myScript 139:myScript 647:63.85% 644:13,719 641:79.92% 638:17,172 632:14,078 604:AJSJSM 351:message 339:console 330:message 635:65.5% 445:window 421:window 372:params 240:params 204:window 180:window 127:Object 115:append 86:append 54:source 40:JSHint 402:debug 390:text1 318:debug 222:text1 16:< 565:text 378:text 133:keys 436:var 433:{}; 345:log 195:var 192:{}; 577:AA 559:AB 550:}; 520:AC 511:}; 481:AB 463:AA 411:); 360:}; 354:); 309:}; 270:}; 151:); 112:). 103:$ 95:); 83:). 74:$ 580:; 574:. 568:= 562:. 556:. 544:: 538:, 532:: 526:{ 523:= 517:. 505:: 499:, 493:: 487:{ 484:= 478:. 472:; 466:= 460:. 454:; 448:. 442:= 430:= 424:. 405:( 399:. 393:; 387:. 381:= 375:. 369:. 348:( 342:. 336:{ 333:) 327:( 321:= 315:. 303:: 297:, 291:: 285:{ 282:= 276:. 264:: 258:, 252:: 246:{ 243:= 237:. 231:; 225:= 219:. 213:; 207:. 201:= 189:= 183:. 145:+ 142:) 136:( 130:. 124:+ 118:( 106:( 89:( 77:(

Index

User:Alexis Jazz
User:Alexis Jazz/Bawl
JSHint
source
https://lisperator.net/uglifyjs/#demo
No problem.
AJSJSMangler.js

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.