Skip to content

Commit

Permalink
Add doc that received url parameter must be a valid URL
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
madnificent committed Dec 31, 2020
1 parent 4cddd84 commit b1b8966
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions apply-css/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b1b8966

Please sign in to comment.