isURLSameOrigin.js 420 B

1234567891011121314
  1. import platform from '../platform/index.js';
  2. export default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
  3. url = new URL(url, platform.origin);
  4. return (
  5. origin.protocol === url.protocol &&
  6. origin.host === url.host &&
  7. (isMSIE || origin.port === url.port)
  8. );
  9. })(
  10. new URL(platform.origin),
  11. platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
  12. ) : () => true;