-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the way Survol differentiates URLs, not only by domain, but also subdomain #149
base: master
Are you sure you want to change the base?
Conversation
It makes sense, then maybe we should add some kind of regex in the settings when disabling inner links also, so people can type in something like *.github.com or just gist.github.com for example. |
hum no, this is manifest related. Currently the extension has 2 options to disable it :
Things that should be done :
|
The link you sent earlier explains how to enable / disable the extension via the manifest.json file, which is not what we want, we want to enable / disable the extension programatically through the extension itself. But yea basically we should implement it like you did in the image you sent, the user should be able to input things like "*.github.com" (== "github.com") "gist.github.com", ... |
Ohh, you misunderstood me 😆 |
I think all the changes should be implemented in this PR as otherwise everything would break |
in the onboarding page
instead of just a domain
I'm not sure if you're done with this, but we need to adapt the way we disable the extension in core.js - master - 230 in order to make sure if someone blocks the extension on github.com it blocks it on every subdomain, but if someone blocks only 1 subdomain the extension will be disabled only on this one. Should also apply the same way of blocking to inner link preview core.js - master - 218 |
Wouldn't it be better to be left like this? If user blocks the extension on |
Yes but right now without modifying anything if you block "github.com" it will only block the extension on github.com and not on every subdomains because you've added subdomains in you getDomain function. That's why I think we should differentiate : Also when the user turns the switch off in the popup it should add the domain as domain.tld or subdomain.tld and not *.domain.tld to the list of blocked sites. Then if the user wants to block every subdomain they can by going in the settings page and adding a *. before the domain Anyway changes are needed to how we detect when to block the extension |
That's what I mean mate. But there's a problem, what if user wants to block all subdomains except for one. |
I guess we could modify the regex to to add an exception for a list of selected subdomains |
Maybe we could use exclamation mark |
Or could be like UserScript, but that would be very complicated. |
I'm not a regex pro but something like this I guess (assuming gist is blocked)
In this example gist.github.com, github.com and cdn.github.com are whitelisted, everything else is blocked, |
For example, this and this are completely different website, although has same domain name. But, Survol treat those as same.
![](https://camo.githubusercontent.com/c59d1ac1b3b0edcedde4357164186547b0afd427ce65ddaf99c06fe975b6f0e7/68747470733a2f2f692e696d6775722e636f6d2f6d544f734f545a2e6a7067)
This changes will make Survol treat those websites different. So if you disable Survol on one page, the other page have no effect.