Add doc that received url parameter must be a valid URL

The `new URL(url)` statement will throw an error if the supplied
string is not a valid URL.  Adding a note to the function to clarify
that as requested by @Rob--W.
This commit is contained in:
Aad Versteden
2020-12-31 13:28:25 +01:00
parent 4cddd8497c
commit b1b896627a

View File

@@ -27,6 +27,7 @@ function toggleCSS(tab) {
/*
Returns true only if the URL's protocol is in APPLICABLE_PROTOCOLS.
Argument url must be a valid URL string.
*/
function protocolIsApplicable(url) {
const protocol = (new URL(url)).protocol;