From b1b896627a31dd4e365d59bbb8afb77f93e25afb Mon Sep 17 00:00:00 2001 From: Aad Versteden Date: Thu, 31 Dec 2020 13:28:25 +0100 Subject: [PATCH] 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. --- apply-css/background.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apply-css/background.js b/apply-css/background.js index 039a6974..8846b0b1 100644 --- a/apply-css/background.js +++ b/apply-css/background.js @@ -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;