From d759fde7f33da1b93ed3571ab254acefa0f0fdc9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 7 Sep 2021 23:55:56 +0200 Subject: background: Describe the `wildcard_domains` function --- background.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'background.js') diff --git a/background.js b/background.js index 7a884a1..7553a30 100644 --- a/background.js +++ b/background.js @@ -35,7 +35,12 @@ browser.runtime.onMessage.addListener(function(message) { }); -// function insert_css (hostname) { +// Build a list of wildcard domains from the given hostname. +// +// Example: +// +// wildcard_domains('en.wikipedia.org'); +// => [ '*', '*.org', '*.wikipedia.org', 'en.wikipedia.org' ] function wildcard_domains (hostname) { var domain_parts = hostname.split('.'); var domains = []; -- cgit v1.2.3