Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.1
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
amatya /
node_modules /
core-js /
modules /
[ HOME SHELL ]
Name
Size
Permission
Action
README.md
164
B
-rw-r--r--
es.array-buffer.constructor.js
458
B
-rw-r--r--
es.array-buffer.is-view.js
392
B
-rw-r--r--
es.array-buffer.slice.js
1.44
KB
-rw-r--r--
es.array.concat.js
1.97
KB
-rw-r--r--
es.array.copy-within.js
360
B
-rw-r--r--
es.array.every.js
457
B
-rw-r--r--
es.array.fill.js
327
B
-rw-r--r--
es.array.filter.js
518
B
-rw-r--r--
es.array.find-index.js
735
B
-rw-r--r--
es.array.find.js
676
B
-rw-r--r--
es.array.flat-map.js
757
B
-rw-r--r--
es.array.flat.js
760
B
-rw-r--r--
es.array.for-each.js
287
B
-rw-r--r--
es.array.from.js
348
B
-rw-r--r--
es.array.includes.js
532
B
-rw-r--r--
es.array.index-of.js
702
B
-rw-r--r--
es.array.is-array.js
191
B
-rw-r--r--
es.array.iterator.js
2.16
KB
-rw-r--r--
es.array.join.js
588
B
-rw-r--r--
es.array.last-index-of.js
324
B
-rw-r--r--
es.array.map.js
497
B
-rw-r--r--
es.array.of.js
740
B
-rw-r--r--
es.array.reduce-right.js
524
B
-rw-r--r--
es.array.reduce.js
490
B
-rw-r--r--
es.array.reverse.js
533
B
-rw-r--r--
es.array.slice.js
1.83
KB
-rw-r--r--
es.array.some.js
450
B
-rw-r--r--
es.array.sort.js
876
B
-rw-r--r--
es.array.species.js
134
B
-rw-r--r--
es.array.splice.js
2.5
KB
-rw-r--r--
es.array.unscopables.flat-map....
174
B
-rw-r--r--
es.array.unscopables.flat.js
171
B
-rw-r--r--
es.data-view.js
324
B
-rw-r--r--
es.date.now.js
199
B
-rw-r--r--
es.date.to-iso-string.js
372
B
-rw-r--r--
es.date.to-json.js
705
B
-rw-r--r--
es.date.to-primitive.js
420
B
-rw-r--r--
es.date.to-string.js
579
B
-rw-r--r--
es.function.bind.js
219
B
-rw-r--r--
es.function.has-instance.js
893
B
-rw-r--r--
es.function.name.js
679
B
-rw-r--r--
es.json.to-string-tag.js
184
B
-rw-r--r--
es.map.js
311
B
-rw-r--r--
es.math.acosh.js
692
B
-rw-r--r--
es.math.asinh.js
433
B
-rw-r--r--
es.math.atanh.js
376
B
-rw-r--r--
es.math.cbrt.js
304
B
-rw-r--r--
es.math.clz32.js
307
B
-rw-r--r--
es.math.cosh.js
416
B
-rw-r--r--
es.math.expm1.js
277
B
-rw-r--r--
es.math.fround.js
188
B
-rw-r--r--
es.math.hypot.js
702
B
-rw-r--r--
es.math.imul.js
623
B
-rw-r--r--
es.math.log10.js
250
B
-rw-r--r--
es.math.log1p.js
184
B
-rw-r--r--
es.math.log2.js
237
B
-rw-r--r--
es.math.sign.js
180
B
-rw-r--r--
es.math.sinh.js
549
B
-rw-r--r--
es.math.tanh.js
372
B
-rw-r--r--
es.math.to-string-tag.js
153
B
-rw-r--r--
es.math.trunc.js
263
B
-rw-r--r--
es.number.constructor.js
3.44
KB
-rw-r--r--
es.number.epsilon.js
180
B
-rw-r--r--
es.number.is-finite.js
207
B
-rw-r--r--
es.number.is-integer.js
204
B
-rw-r--r--
es.number.is-nan.js
263
B
-rw-r--r--
es.number.is-safe-integer.js
356
B
-rw-r--r--
es.number.max-safe-integer.js
207
B
-rw-r--r--
es.number.min-safe-integer.js
208
B
-rw-r--r--
es.number.parse-float.js
279
B
-rw-r--r--
es.number.parse-int.js
263
B
-rw-r--r--
es.number.to-fixed.js
2.81
KB
-rw-r--r--
es.number.to-precision.js
730
B
-rw-r--r--
es.object.assign.js
252
B
-rw-r--r--
es.object.create.js
242
B
-rw-r--r--
es.object.define-getter.js
710
B
-rw-r--r--
es.object.define-properties.js
337
B
-rw-r--r--
es.object.define-property.js
331
B
-rw-r--r--
es.object.define-setter.js
710
B
-rw-r--r--
es.object.entries.js
286
B
-rw-r--r--
es.object.freeze.js
599
B
-rw-r--r--
es.object.from-entries.js
452
B
-rw-r--r--
es.object.get-own-property-des...
747
B
-rw-r--r--
es.object.get-own-property-des...
1005
B
-rw-r--r--
es.object.get-own-property-nam...
458
B
-rw-r--r--
es.object.get-prototype-of.js
637
B
-rw-r--r--
es.object.is-extensible.js
519
B
-rw-r--r--
es.object.is-frozen.js
483
B
-rw-r--r--
es.object.is-sealed.js
483
B
-rw-r--r--
es.object.is.js
181
B
-rw-r--r--
es.object.keys.js
438
B
-rw-r--r--
es.object.lookup-getter.js
883
B
-rw-r--r--
es.object.lookup-setter.js
883
B
-rw-r--r--
es.object.prevent-extensions.j...
698
B
-rw-r--r--
es.object.seal.js
581
B
-rw-r--r--
es.object.set-prototype-of.js
232
B
-rw-r--r--
es.object.to-string.js
341
B
-rw-r--r--
es.object.values.js
276
B
-rw-r--r--
es.parse-float.js
291
B
-rw-r--r--
es.parse-int.js
281
B
-rw-r--r--
es.promise.finally.js
839
B
-rw-r--r--
es.promise.js
11.84
KB
-rw-r--r--
es.reflect.apply.js
829
B
-rw-r--r--
es.reflect.construct.js
2.09
KB
-rw-r--r--
es.reflect.define-property.js
1.04
KB
-rw-r--r--
es.reflect.delete-property.js
548
B
-rw-r--r--
es.reflect.get-own-property-de...
577
B
-rw-r--r--
es.reflect.get-prototype-of.js
517
B
-rw-r--r--
es.reflect.get.js
995
B
-rw-r--r--
es.reflect.has.js
228
B
-rw-r--r--
es.reflect.is-extensible.js
403
B
-rw-r--r--
es.reflect.own-keys.js
197
B
-rw-r--r--
es.reflect.prevent-extensions....
655
B
-rw-r--r--
es.reflect.set-prototype-of.js
606
B
-rw-r--r--
es.reflect.set.js
1.66
KB
-rw-r--r--
es.regexp.constructor.js
2.49
KB
-rw-r--r--
es.regexp.exec.js
194
B
-rw-r--r--
es.regexp.flags.js
323
B
-rw-r--r--
es.regexp.to-string.js
899
B
-rw-r--r--
es.set.js
305
B
-rw-r--r--
es.string.anchor.js
416
B
-rw-r--r--
es.string.big.js
393
B
-rw-r--r--
es.string.blink.js
405
B
-rw-r--r--
es.string.bold.js
396
B
-rw-r--r--
es.string.code-point-at.js
347
B
-rw-r--r--
es.string.ends-with.js
1.01
KB
-rw-r--r--
es.string.fixed.js
402
B
-rw-r--r--
es.string.fontcolor.js
437
B
-rw-r--r--
es.string.fontsize.js
429
B
-rw-r--r--
es.string.from-code-point.js
987
B
-rw-r--r--
es.string.includes.js
635
B
-rw-r--r--
es.string.italics.js
411
B
-rw-r--r--
es.string.iterator.js
1.03
KB
-rw-r--r--
es.string.link.js
404
B
-rw-r--r--
es.string.match.js
1.61
KB
-rw-r--r--
es.string.pad-end.js
501
B
-rw-r--r--
es.string.pad-start.js
508
B
-rw-r--r--
es.string.raw.js
668
B
-rw-r--r--
es.string.repeat.js
219
B
-rw-r--r--
es.string.replace.js
4.96
KB
-rw-r--r--
es.string.search.js
1.39
KB
-rw-r--r--
es.string.small.js
405
B
-rw-r--r--
es.string.split.js
5.49
KB
-rw-r--r--
es.string.starts-with.js
943
B
-rw-r--r--
es.string.strike.js
411
B
-rw-r--r--
es.string.sub.js
393
B
-rw-r--r--
es.string.sup.js
393
B
-rw-r--r--
es.string.trim-end.js
494
B
-rw-r--r--
es.string.trim-start.js
508
B
-rw-r--r--
es.string.trim.js
402
B
-rw-r--r--
es.symbol.async-iterator.js
171
B
-rw-r--r--
es.symbol.description.js
2.04
KB
-rw-r--r--
es.symbol.has-instance.js
165
B
-rw-r--r--
es.symbol.is-concat-spreadable...
186
B
-rw-r--r--
es.symbol.iterator.js
156
B
-rw-r--r--
es.symbol.js
11.47
KB
-rw-r--r--
es.symbol.match.js
147
B
-rw-r--r--
es.symbol.replace.js
153
B
-rw-r--r--
es.symbol.search.js
150
B
-rw-r--r--
es.symbol.species.js
153
B
-rw-r--r--
es.symbol.split.js
147
B
-rw-r--r--
es.symbol.to-primitive.js
165
B
-rw-r--r--
es.symbol.to-string-tag.js
165
B
-rw-r--r--
es.symbol.unscopables.js
165
B
-rw-r--r--
es.typed-array.copy-within.js
537
B
-rw-r--r--
es.typed-array.every.js
499
B
-rw-r--r--
es.typed-array.fill.js
484
B
-rw-r--r--
es.typed-array.filter.js
880
B
-rw-r--r--
es.typed-array.find-index.js
521
B
-rw-r--r--
es.typed-array.find.js
491
B
-rw-r--r--
es.typed-array.float32-array.j...
285
B
-rw-r--r--
es.typed-array.float64-array.j...
285
B
-rw-r--r--
es.typed-array.for-each.js
504
B
-rw-r--r--
es.typed-array.from.js
461
B
-rw-r--r--
es.typed-array.includes.js
529
B
-rw-r--r--
es.typed-array.index-of.js
524
B
-rw-r--r--
es.typed-array.int16-array.js
279
B
-rw-r--r--
es.typed-array.int32-array.js
279
B
-rw-r--r--
es.typed-array.int8-array.js
276
B
-rw-r--r--
es.typed-array.iterator.js
1.54
KB
-rw-r--r--
es.typed-array.join.js
442
B
-rw-r--r--
es.typed-array.last-index-of.j...
542
B
-rw-r--r--
es.typed-array.map.js
758
B
-rw-r--r--
es.typed-array.of.js
669
B
-rw-r--r--
es.typed-array.reduce-right.js
513
B
-rw-r--r--
es.typed-array.reduce.js
478
B
-rw-r--r--
es.typed-array.reverse.js
581
B
-rw-r--r--
es.typed-array.set.js
913
B
-rw-r--r--
es.typed-array.slice.js
919
B
-rw-r--r--
es.typed-array.some.js
493
B
-rw-r--r--
es.typed-array.sort.js
398
B
-rw-r--r--
es.typed-array.subarray.js
837
B
-rw-r--r--
es.typed-array.to-locale-strin...
975
B
-rw-r--r--
es.typed-array.to-string.js
658
B
-rw-r--r--
es.typed-array.uint16-array.js
282
B
-rw-r--r--
es.typed-array.uint32-array.js
282
B
-rw-r--r--
es.typed-array.uint8-array.js
279
B
-rw-r--r--
es.typed-array.uint8-clamped-a...
299
B
-rw-r--r--
es.weak-map.js
2.7
KB
-rw-r--r--
es.weak-set.js
319
B
-rw-r--r--
esnext.aggregate-error.js
1.01
KB
-rw-r--r--
esnext.array.last-index.js
656
B
-rw-r--r--
esnext.array.last-item.js
822
B
-rw-r--r--
esnext.composite-key.js
569
B
-rw-r--r--
esnext.composite-symbol.js
510
B
-rw-r--r--
esnext.global-this.js
164
B
-rw-r--r--
esnext.map.delete-all.js
415
B
-rw-r--r--
esnext.map.every.js
784
B
-rw-r--r--
esnext.map.filter.js
1.1
KB
-rw-r--r--
esnext.map.find-key.js
785
B
-rw-r--r--
esnext.map.find.js
782
B
-rw-r--r--
esnext.map.from.js
200
B
-rw-r--r--
esnext.map.group-by.js
785
B
-rw-r--r--
esnext.map.includes.js
673
B
-rw-r--r--
esnext.map.key-by.js
584
B
-rw-r--r--
esnext.map.key-of.js
608
B
-rw-r--r--
esnext.map.map-keys.js
1.08
KB
-rw-r--r--
esnext.map.map-values.js
1.08
KB
-rw-r--r--
esnext.map.merge.js
665
B
-rw-r--r--
esnext.map.of.js
192
B
-rw-r--r--
esnext.map.reduce.js
980
B
-rw-r--r--
esnext.map.some.js
780
B
-rw-r--r--
esnext.map.update.js
731
B
-rw-r--r--
esnext.math.clamp.js
274
B
-rw-r--r--
esnext.math.deg-per-rad.js
183
B
-rw-r--r--
esnext.math.degrees.js
261
B
-rw-r--r--
esnext.math.fscale.js
376
B
-rw-r--r--
esnext.math.iaddh.js
361
B
-rw-r--r--
esnext.math.imulh.js
466
B
-rw-r--r--
esnext.math.isubh.js
360
B
-rw-r--r--
esnext.math.rad-per-deg.js
183
B
-rw-r--r--
esnext.math.radians.js
261
B
-rw-r--r--
esnext.math.scale.js
190
B
-rw-r--r--
esnext.math.seeded-prng.js
1.43
KB
-rw-r--r--
esnext.math.signbit.js
287
B
-rw-r--r--
esnext.math.umulh.js
470
B
-rw-r--r--
esnext.number.from-string.js
1.08
KB
-rw-r--r--
esnext.observable.js
6.66
KB
-rw-r--r--
esnext.promise.all-settled.js
1.35
KB
-rw-r--r--
esnext.promise.any.js
1.51
KB
-rw-r--r--
esnext.promise.try.js
553
B
-rw-r--r--
esnext.reflect.define-metadata...
658
B
-rw-r--r--
esnext.reflect.delete-metadata...
951
B
-rw-r--r--
esnext.reflect.get-metadata-ke...
1.15
KB
-rw-r--r--
esnext.reflect.get-metadata.js
1.02
KB
-rw-r--r--
esnext.reflect.get-own-metadat...
618
B
-rw-r--r--
esnext.reflect.get-own-metadat...
629
B
-rw-r--r--
esnext.reflect.has-metadata.js
947
B
-rw-r--r--
esnext.reflect.has-own-metadat...
629
B
-rw-r--r--
esnext.reflect.metadata.js
593
B
-rw-r--r--
esnext.set.add-all.js
395
B
-rw-r--r--
esnext.set.delete-all.js
413
B
-rw-r--r--
esnext.set.difference.js
798
B
-rw-r--r--
esnext.set.every.js
765
B
-rw-r--r--
esnext.set.filter.js
1.05
KB
-rw-r--r--
esnext.set.find.js
748
B
-rw-r--r--
esnext.set.from.js
200
B
-rw-r--r--
esnext.set.intersection.js
861
B
-rw-r--r--
esnext.set.is-disjoint-from.js
684
B
-rw-r--r--
esnext.set.is-subset-of.js
991
B
-rw-r--r--
esnext.set.is-superset-of.js
677
B
-rw-r--r--
esnext.set.join.js
642
B
-rw-r--r--
esnext.set.map.js
1.03
KB
-rw-r--r--
esnext.set.of.js
192
B
-rw-r--r--
esnext.set.reduce.js
958
B
-rw-r--r--
esnext.set.some.js
761
B
-rw-r--r--
esnext.set.symmetric-differenc...
893
B
-rw-r--r--
esnext.set.union.js
706
B
-rw-r--r--
esnext.string.at.js
298
B
-rw-r--r--
esnext.string.code-points.js
1.3
KB
-rw-r--r--
esnext.string.match-all.js
3.36
KB
-rw-r--r--
esnext.string.replace-all.js
939
B
-rw-r--r--
esnext.symbol.dispose.js
156
B
-rw-r--r--
esnext.symbol.observable.js
111
B
-rw-r--r--
esnext.symbol.pattern-match.js
162
B
-rw-r--r--
esnext.weak-map.delete-all.js
423
B
-rw-r--r--
esnext.weak-map.from.js
212
B
-rw-r--r--
esnext.weak-map.of.js
204
B
-rw-r--r--
esnext.weak-set.add-all.js
426
B
-rw-r--r--
esnext.weak-set.delete-all.js
444
B
-rw-r--r--
esnext.weak-set.from.js
212
B
-rw-r--r--
esnext.weak-set.of.js
204
B
-rw-r--r--
web.dom-collections.for-each.j...
619
B
-rw-r--r--
web.dom-collections.iterator.j...
1.4
KB
-rw-r--r--
web.immediate.js
304
B
-rw-r--r--
web.queue-microtask.js
528
B
-rw-r--r--
web.timers.js
766
B
-rw-r--r--
web.url-search-params.js
9.61
KB
-rw-r--r--
web.url.js
31.56
KB
-rw-r--r--
web.url.to-json.js
261
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : web.url.js
'use strict'; require('../modules/es.string.iterator'); var DESCRIPTORS = require('../internals/descriptors'); var USE_NATIVE_URL = require('../internals/native-url'); var NativeURL = require('../internals/global').URL; var defineProperties = require('../internals/object-define-properties'); var redefine = require('../internals/redefine'); var anInstance = require('../internals/an-instance'); var has = require('../internals/has'); var assign = require('../internals/object-assign'); var arrayFrom = require('../internals/array-from'); var codePointAt = require('../internals/string-at'); var toASCII = require('../internals/punycode-to-ascii'); var URLSearchParamsModule = require('../modules/web.url-search-params'); var URLSearchParams = URLSearchParamsModule.URLSearchParams; var getInternalSearchParamsState = URLSearchParamsModule.getState; var InternalStateModule = require('../internals/internal-state'); var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var pow = Math.pow; var INVALID_AUTHORITY = 'Invalid authority'; var INVALID_SCHEME = 'Invalid scheme'; var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; var ALPHA = /[a-zA-Z]/; var ALPHANUMERIC = /[a-zA-Z0-9+\-.]/; var DIGIT = /\d/; var HEX_START = /^(0x|0X)/; var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[0-9A-Fa-f]+$/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT = /\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/; // eslint-disable-next-line no-control-regex var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g; // eslint-disable-next-line no-control-regex var TAB_AND_NEW_LINE = /\u0009|\u000A|\u000D/g; var EOF; var parseHost = function (url, input) { var result, codePoints, i; if (input.charAt(0) == '[') { if (input.charAt(input.length - 1) != ']') return INVALID_HOST; result = parseIPv6(input.slice(1, -1)); if (!result) return INVALID_HOST; url.host = result; // opaque host } else if (!isSpecial(url)) { if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); for (i = 0; i < codePoints.length; i++) result += percentEncode(codePoints[i], C0ControlPercentEncodeSet); url.host = result; } else { input = toASCII(input); if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; result = parseIPv4(input); if (result === null) return INVALID_HOST; url.host = result; } }; var parseIPv4 = function (input) { var parts = input.split('.'); var partsLength, numbers, i, part, R, n, ipv4; if (parts[parts.length - 1] == '') { if (parts.length) parts.pop(); } partsLength = parts.length; if (partsLength > 4) return input; numbers = []; for (i = 0; i < partsLength; i++) { part = parts[i]; if (part == '') return input; R = 10; if (part.length > 1 && part.charAt(0) == '0') { R = HEX_START.test(part) ? 16 : 8; part = part.slice(R == 8 ? 1 : 2); } if (part === '') { n = 0; } else { if (!(R == 10 ? DEC : R == 8 ? OCT : HEX).test(part)) return input; n = parseInt(part, R); } numbers.push(n); } for (i = 0; i < partsLength; i++) { n = numbers[i]; if (i == partsLength - 1) { if (n >= pow(256, 5 - partsLength)) return null; } else if (n > 255) return null; } ipv4 = numbers.pop(); for (i = 0; i < numbers.length; i++) { ipv4 += numbers[i] * pow(256, 3 - i); } return ipv4; }; // eslint-disable-next-line max-statements var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; var compress = null; var pointer = 0; var value, length, numbersSeen, ipv4Piece, number, swaps, swap; var char = function () { return input.charAt(pointer); }; if (char() == ':') { if (input.charAt(1) != ':') return; pointer += 2; pieceIndex++; compress = pieceIndex; } while (char()) { if (pieceIndex == 8) return; if (char() == ':') { if (compress !== null) return; pointer++; pieceIndex++; compress = pieceIndex; continue; } value = length = 0; while (length < 4 && HEX.test(char())) { value = value * 16 + parseInt(char(), 16); pointer++; length++; } if (char() == '.') { if (length == 0) return; pointer -= length; if (pieceIndex > 6) return; numbersSeen = 0; while (char()) { ipv4Piece = null; if (numbersSeen > 0) { if (char() == '.' && numbersSeen < 4) pointer++; else return; } if (!DIGIT.test(char())) return; while (DIGIT.test(char())) { number = parseInt(char(), 10); if (ipv4Piece === null) ipv4Piece = number; else if (ipv4Piece == 0) return; else ipv4Piece = ipv4Piece * 10 + number; if (ipv4Piece > 255) return; pointer++; } address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; numbersSeen++; if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; } if (numbersSeen != 4) return; break; } else if (char() == ':') { pointer++; if (!char()) return; } else if (char()) return; address[pieceIndex++] = value; } if (compress !== null) { swaps = pieceIndex - compress; pieceIndex = 7; while (pieceIndex != 0 && swaps > 0) { swap = address[pieceIndex]; address[pieceIndex--] = address[compress + swaps - 1]; address[compress + --swaps] = swap; } } else if (pieceIndex != 8) return; return address; }; var findLongestZeroSequence = function (ipv6) { var maxIndex = null; var maxLength = 1; var currStart = null; var currLength = 0; var i = 0; for (; i < 8; i++) { if (ipv6[i] !== 0) { if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } currStart = null; currLength = 0; } else { if (currStart === null) currStart = i; ++currLength; } } if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } return maxIndex; }; var serializeHost = function (host) { var result, i, compress, ignore0; // ipv4 if (typeof host == 'number') { result = []; for (i = 0; i < 4; i++) { result.unshift(host % 256); host = Math.floor(host / 256); } return result.join('.'); // ipv6 } else if (typeof host == 'object') { result = ''; compress = findLongestZeroSequence(host); for (i = 0; i < 8; i++) { if (ignore0 && host[i] === 0) continue; if (ignore0) ignore0 = false; if (compress === i) { result += i ? ':' : '::'; ignore0 = true; } else { result += host[i].toString(16); if (i < 7) result += ':'; } } return '[' + result + ']'; } return host; }; var C0ControlPercentEncodeSet = {}; var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }); var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { '#': 1, '?': 1, '{': 1, '}': 1 }); var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 }); var percentEncode = function (char, set) { var code = codePointAt(char, 0); return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char); }; var specialSchemes = { ftp: 21, file: null, gopher: 70, http: 80, https: 443, ws: 80, wss: 443 }; var isSpecial = function (url) { return has(specialSchemes, url.scheme); }; var includesCredentials = function (url) { return url.username != '' || url.password != ''; }; var cannotHaveUsernamePasswordPort = function (url) { return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; }; var isWindowsDriveLetter = function (string, normalized) { var second; return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); }; var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( string.length == 2 || ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') ); }; var shortenURLsPath = function (url) { var path = url.path; var pathSize = path.length; if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { path.pop(); } }; var isSingleDot = function (segment) { return segment === '.' || segment.toLowerCase() === '%2e'; }; var isDoubleDot = function (segment) { segment = segment.toLowerCase(); return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; }; // States: var SCHEME_START = {}; var SCHEME = {}; var NO_SCHEME = {}; var SPECIAL_RELATIVE_OR_AUTHORITY = {}; var PATH_OR_AUTHORITY = {}; var RELATIVE = {}; var RELATIVE_SLASH = {}; var SPECIAL_AUTHORITY_SLASHES = {}; var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; var AUTHORITY = {}; var HOST = {}; var HOSTNAME = {}; var PORT = {}; var FILE = {}; var FILE_SLASH = {}; var FILE_HOST = {}; var PATH_START = {}; var PATH = {}; var CANNOT_BE_A_BASE_URL_PATH = {}; var QUERY = {}; var FRAGMENT = {}; // eslint-disable-next-line max-statements var parseURL = function (url, input, stateOverride, base) { var state = stateOverride || SCHEME_START; var pointer = 0; var buffer = ''; var seenAt = false; var seenBracket = false; var seenPasswordToken = false; var codePoints, char, bufferCodePoints, failure; if (!stateOverride) { url.scheme = ''; url.username = ''; url.password = ''; url.host = null; url.port = null; url.path = []; url.query = null; url.fragment = null; url.cannotBeABaseURL = false; input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); } input = input.replace(TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); while (pointer <= codePoints.length) { char = codePoints[pointer]; switch (state) { case SCHEME_START: if (char && ALPHA.test(char)) { buffer += char.toLowerCase(); state = SCHEME; } else if (!stateOverride) { state = NO_SCHEME; continue; } else return INVALID_SCHEME; break; case SCHEME: if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { buffer += char.toLowerCase(); } else if (char == ':') { if (stateOverride) { if ( (isSpecial(url) != has(specialSchemes, buffer)) || (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || (url.scheme == 'file' && !url.host) ) return; } url.scheme = buffer; if (stateOverride) { if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; return; } buffer = ''; if (url.scheme == 'file') { state = FILE; } else if (isSpecial(url) && base && base.scheme == url.scheme) { state = SPECIAL_RELATIVE_OR_AUTHORITY; } else if (isSpecial(url)) { state = SPECIAL_AUTHORITY_SLASHES; } else if (codePoints[pointer + 1] == '/') { state = PATH_OR_AUTHORITY; pointer++; } else { url.cannotBeABaseURL = true; url.path.push(''); state = CANNOT_BE_A_BASE_URL_PATH; } } else if (!stateOverride) { buffer = ''; state = NO_SCHEME; pointer = 0; continue; } else return INVALID_SCHEME; break; case NO_SCHEME: if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME; if (base.cannotBeABaseURL && char == '#') { url.scheme = base.scheme; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; url.cannotBeABaseURL = true; state = FRAGMENT; break; } state = base.scheme == 'file' ? FILE : RELATIVE; continue; case SPECIAL_RELATIVE_OR_AUTHORITY: if (char == '/' && codePoints[pointer + 1] == '/') { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; pointer++; } else { state = RELATIVE; continue; } break; case PATH_OR_AUTHORITY: if (char == '/') { state = AUTHORITY; break; } else { state = PATH; continue; } case RELATIVE: url.scheme = base.scheme; if (char == EOF) { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; } else if (char == '/' || (char == '\\' && isSpecial(url))) { state = RELATIVE_SLASH; } else if (char == '?') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.path.pop(); state = PATH; continue; } break; case RELATIVE_SLASH: if (isSpecial(url) && (char == '/' || char == '\\')) { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; } else if (char == '/') { state = AUTHORITY; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; state = PATH; continue; } break; case SPECIAL_AUTHORITY_SLASHES: state = SPECIAL_AUTHORITY_IGNORE_SLASHES; if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; pointer++; break; case SPECIAL_AUTHORITY_IGNORE_SLASHES: if (char != '/' && char != '\\') { state = AUTHORITY; continue; } break; case AUTHORITY: if (char == '@') { if (seenAt) buffer = '%40' + buffer; seenAt = true; bufferCodePoints = arrayFrom(buffer); for (var i = 0; i < bufferCodePoints.length; i++) { var codePoint = bufferCodePoints[i]; if (codePoint == ':' && !seenPasswordToken) { seenPasswordToken = true; continue; } var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); if (seenPasswordToken) url.password += encodedCodePoints; else url.username += encodedCodePoints; } buffer = ''; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (seenAt && buffer == '') return INVALID_AUTHORITY; pointer -= arrayFrom(buffer).length + 1; buffer = ''; state = HOST; } else buffer += char; break; case HOST: case HOSTNAME: if (stateOverride && url.scheme == 'file') { state = FILE_HOST; continue; } else if (char == ':' && !seenBracket) { if (buffer == '') return INVALID_HOST; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PORT; if (stateOverride == HOSTNAME) return; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (isSpecial(url) && buffer == '') return INVALID_HOST; if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PATH_START; if (stateOverride) return; continue; } else { if (char == '[') seenBracket = true; else if (char == ']') seenBracket = false; buffer += char; } break; case PORT: if (DIGIT.test(char)) { buffer += char; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) || stateOverride ) { if (buffer != '') { var port = parseInt(buffer, 10); if (port > 0xFFFF) return INVALID_PORT; url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port; buffer = ''; } if (stateOverride) return; state = PATH_START; continue; } else return INVALID_PORT; break; case FILE: url.scheme = 'file'; if (char == '/' || char == '\\') state = FILE_SLASH; else if (base && base.scheme == 'file') { if (char == EOF) { url.host = base.host; url.path = base.path.slice(); url.query = base.query; } else if (char == '?') { url.host = base.host; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.host = base.host; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { url.host = base.host; url.path = base.path.slice(); shortenURLsPath(url); } state = PATH; continue; } } else { state = PATH; continue; } break; case FILE_SLASH: if (char == '/' || char == '\\') { state = FILE_HOST; break; } if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); else url.host = base.host; } state = PATH; continue; case FILE_HOST: if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { if (!stateOverride && isWindowsDriveLetter(buffer)) { state = PATH; } else if (buffer == '') { url.host = ''; if (stateOverride) return; state = PATH_START; } else { failure = parseHost(url, buffer); if (failure) return failure; if (url.host == 'localhost') url.host = ''; if (stateOverride) return; buffer = ''; state = PATH_START; } continue; } else buffer += char; break; case PATH_START: if (isSpecial(url)) { state = PATH; if (char != '/' && char != '\\') continue; } else if (!stateOverride && char == '?') { url.query = ''; state = QUERY; } else if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { state = PATH; if (char != '/') continue; } break; case PATH: if ( char == EOF || char == '/' || (char == '\\' && isSpecial(url)) || (!stateOverride && (char == '?' || char == '#')) ) { if (isDoubleDot(buffer)) { shortenURLsPath(url); if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else if (isSingleDot(buffer)) { if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else { if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { if (url.host) url.host = ''; buffer = buffer.charAt(0) + ':'; // normalize windows drive letter } url.path.push(buffer); } buffer = ''; if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { while (url.path.length > 1 && url.path[0] === '') { url.path.shift(); } } if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } } else { buffer += percentEncode(char, pathPercentEncodeSet); } break; case CANNOT_BE_A_BASE_URL_PATH: if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); } break; case QUERY: if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { if (char == "'" && isSpecial(url)) url.query += '%27'; else if (char == '#') url.query += '%23'; else url.query += percentEncode(char, C0ControlPercentEncodeSet); } break; case FRAGMENT: if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); break; } pointer++; } }; // `URL` constructor // https://url.spec.whatwg.org/#url-class var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLConstructor, 'URL'); var base = arguments.length > 1 ? arguments[1] : undefined; var urlString = String(url); var state = setInternalState(that, { type: 'URL' }); var baseState, failure; if (base !== undefined) { if (base instanceof URLConstructor) baseState = getInternalURLState(base); else { failure = parseURL(baseState = {}, String(base)); if (failure) throw TypeError(failure); } } failure = parseURL(state, urlString, null, baseState); if (failure) throw TypeError(failure); var searchParams = state.searchParams = new URLSearchParams(); var searchParamsState = getInternalSearchParamsState(searchParams); searchParamsState.updateSearchParams(state.query); searchParamsState.updateURL = function () { state.query = String(searchParams) || null; }; if (!DESCRIPTORS) { that.href = serializeURL.call(that); that.origin = getOrigin.call(that); that.protocol = getProtocol.call(that); that.username = getUsername.call(that); that.password = getPassword.call(that); that.host = getHost.call(that); that.hostname = getHostname.call(that); that.port = getPort.call(that); that.pathname = getPathname.call(that); that.search = getSearch.call(that); that.searchParams = getSearchParams.call(that); that.hash = getHash.call(that); } }; var URLPrototype = URLConstructor.prototype; var serializeURL = function () { var url = getInternalURLState(this); var scheme = url.scheme; var username = url.username; var password = url.password; var host = url.host; var port = url.port; var path = url.path; var query = url.query; var fragment = url.fragment; var output = scheme + ':'; if (host !== null) { output += '//'; if (includesCredentials(url)) { output += username + (password ? ':' + password : '') + '@'; } output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme == 'file') output += '//'; output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; return output; }; var getOrigin = function () { var url = getInternalURLState(this); var scheme = url.scheme; var port = url.port; if (scheme == 'blob') try { return new URL(scheme.path[0]).origin; } catch (error) { return 'null'; } if (scheme == 'file' || !isSpecial(url)) return 'null'; return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); }; var getProtocol = function () { return getInternalURLState(this).scheme + ':'; }; var getUsername = function () { return getInternalURLState(this).username; }; var getPassword = function () { return getInternalURLState(this).password; }; var getHost = function () { var url = getInternalURLState(this); var host = url.host; var port = url.port; return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; }; var getHostname = function () { var host = getInternalURLState(this).host; return host === null ? '' : serializeHost(host); }; var getPort = function () { var port = getInternalURLState(this).port; return port === null ? '' : String(port); }; var getPathname = function () { var url = getInternalURLState(this); var path = url.path; return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; }; var getSearch = function () { var query = getInternalURLState(this).query; return query ? '?' + query : ''; }; var getSearchParams = function () { return getInternalURLState(this).searchParams; }; var getHash = function () { var fragment = getInternalURLState(this).fragment; return fragment ? '#' + fragment : ''; }; var accessorDescriptor = function (getter, setter) { return { get: getter, set: setter, configurable: true, enumerable: true }; }; if (DESCRIPTORS) { defineProperties(URLPrototype, { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href href: accessorDescriptor(serializeURL, function (href) { var url = getInternalURLState(this); var urlString = String(href); var failure = parseURL(url, urlString); if (failure) throw TypeError(failure); getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin origin: accessorDescriptor(getOrigin), // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol protocol: accessorDescriptor(getProtocol, function (protocol) { var url = getInternalURLState(this); parseURL(url, String(protocol) + ':', SCHEME_START); }), // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username username: accessorDescriptor(getUsername, function (username) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(username)); if (cannotHaveUsernamePasswordPort(url)) return; url.username = ''; for (var i = 0; i < codePoints.length; i++) { url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password password: accessorDescriptor(getPassword, function (password) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(password)); if (cannotHaveUsernamePasswordPort(url)) return; url.password = ''; for (var i = 0; i < codePoints.length; i++) { url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host host: accessorDescriptor(getHost, function (host) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(host), HOST); }), // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname hostname: accessorDescriptor(getHostname, function (hostname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(hostname), HOSTNAME); }), // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port port: accessorDescriptor(getPort, function (port) { var url = getInternalURLState(this); if (cannotHaveUsernamePasswordPort(url)) return; port = String(port); if (port == '') url.port = null; else parseURL(url, port, PORT); }), // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname pathname: accessorDescriptor(getPathname, function (pathname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; url.path = []; parseURL(url, pathname + '', PATH_START); }), // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search search: accessorDescriptor(getSearch, function (search) { var url = getInternalURLState(this); search = String(search); if (search == '') { url.query = null; } else { if ('?' == search.charAt(0)) search = search.slice(1); url.query = ''; parseURL(url, search, QUERY); } getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams searchParams: accessorDescriptor(getSearchParams), // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash hash: accessorDescriptor(getHash, function (hash) { var url = getInternalURLState(this); hash = String(hash); if (hash == '') { url.fragment = null; return; } if ('#' == hash.charAt(0)) hash = hash.slice(1); url.fragment = ''; parseURL(url, hash, FRAGMENT); }) }); } // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson redefine(URLPrototype, 'toJSON', function toJSON() { return serializeURL.call(this); }, { enumerable: true }); // `URL.prototype.toString` method // https://url.spec.whatwg.org/#URL-stringification-behavior redefine(URLPrototype, 'toString', function toString() { return serializeURL.call(this); }, { enumerable: true }); if (NativeURL) { var nativeCreateObjectURL = NativeURL.createObjectURL; var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL // eslint-disable-next-line no-unused-vars if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { return nativeCreateObjectURL.apply(NativeURL, arguments); }); // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL // eslint-disable-next-line no-unused-vars if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { return nativeRevokeObjectURL.apply(NativeURL, arguments); }); } require('../internals/set-to-string-tag')(URLConstructor, 'URL'); require('../internals/export')({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { URL: URLConstructor });
Close