INNER CODE UNIT · JavaScript

match

MorpheApp/morphe-patches · patches/src/main/resources/spoof/raw/polyfill.js:28

    const match = url.match(/^(https?:)\/\/([^\/?#:]+)(?::(\d+))?([^?#]*)?(\?[^#]*)?(#.*)?$/);
    this.protocol = match ? match[1] : '';
    this.hostname = match ? match[2] : '';
    this.port = match && match[3] ? match[3] : '';
    this.pathname = match && match[4] ? match[4] : '/';
    this.search = match && match[5] ? match[5] : '';
    this.hash = match && match[6] ? match[6] : '';
  };
}

if (typeof window === 'undefined') {
  globalThis.window = globalThis;
}

if (typeof self === 'undefined') {
  globalThis.self = globalThis;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…