diff options
| author | Teddy Wing | 2021-09-07 23:55:56 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-09-07 23:57:34 +0200 | 
| commit | d759fde7f33da1b93ed3571ab254acefa0f0fdc9 (patch) | |
| tree | 5997fae55fe83bfad4ce698c091f2370ea0e68e2 | |
| parent | 9f40fc3d0bcbab0c4ad34cdba90c226b44a1345e (diff) | |
| download | Legibility-d759fde7f33da1b93ed3571ab254acefa0f0fdc9.tar.bz2 | |
background: Describe the `wildcard_domains` function
| -rw-r--r-- | background.js | 7 | 
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 = []; | 
