simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.08k stars 135 forks source link

Wildcard or regex in origin domain #183

Closed bixycler closed 1 year ago

bixycler commented 2 years ago

Currently there are only two places can be wildcarded: the protocol *:// and the whole domain *. But for large domains like googlesource.com, there are a lot of subdomains to be listed. So it's better to be able to wildcard some parts of the domain, eg. *.googlesource.com.

Actually I need to exclude all *.googlesource.com from processing markdown because they are serving rendered HTML already. So this issue is related to #133.

The need to wildcard subdomains is not only limited to exclusion cases (with *://*), like *.googlesource.com, but also in inclusion cases (without *://*) where I want to parse markdown for all docs in *.mydomain.com.

simov commented 1 year ago

The content detection in v5.1 was greatly improved, but regarding wildcard support for origins, currently this is supported:

meaning you can wildcard a subdomain, but only if the * is immediately after the //.

But note that with the new content detection algorithm it will be much less likely for the extension to pick up the incorrect content to render. Have a look at the updated readme.md