Urara-Blog/node_modules/.pnpm-store/v3/files/ed/b5d55c60b1aa67f8b1e49f0bf7427bb7ac143d9a5ee555584b76e901a17631603022821fa6744fca4b326cbeb1bc654082e4d87547e02162b3c7254d06477d
2022-08-14 01:14:53 +08:00

15 lines
542 B
Text

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import '../_version.js';
const getFriendlyURL = (url) => {
const urlObj = new URL(String(url), location.href);
// See https://github.com/GoogleChrome/workbox/issues/2323
// We want to include everything, except for the origin if it's same-origin.
return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
};
export { getFriendlyURL };