You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
781 B
30 lines
781 B
/* |
|
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 {logger} from 'workbox-core/_private/logger.mjs'; |
|
import '../_version.mjs'; |
|
|
|
const getFriendlyURL = (url) => { |
|
const urlObj = new URL(url, location); |
|
if (urlObj.origin === location.origin) { |
|
return urlObj.pathname; |
|
} |
|
return urlObj.href; |
|
}; |
|
|
|
export const messages = { |
|
strategyStart: (strategyName, request) => `Using ${strategyName} to ` + |
|
`respond to '${getFriendlyURL(request.url)}'`, |
|
printFinalResponse: (response) => { |
|
if (response) { |
|
logger.groupCollapsed(`View the final response here.`); |
|
logger.log(response); |
|
logger.groupEnd(); |
|
} |
|
}, |
|
};
|
|
|