aboutsummaryrefslogtreecommitdiffstats
path: root/background.js
diff options
context:
space:
mode:
authorTeddy Wing2021-09-07 23:55:56 +0200
committerTeddy Wing2021-09-07 23:57:34 +0200
commitd759fde7f33da1b93ed3571ab254acefa0f0fdc9 (patch)
tree5997fae55fe83bfad4ce698c091f2370ea0e68e2 /background.js
parent9f40fc3d0bcbab0c4ad34cdba90c226b44a1345e (diff)
downloadLegibility-d759fde7f33da1b93ed3571ab254acefa0f0fdc9.tar.bz2
background: Describe the `wildcard_domains` function
Diffstat (limited to 'background.js')
-rw-r--r--background.js7
1 files changed, 6 insertions, 1 deletions
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 = [];