mdolr / survol

A browser extension to preview any link you hover
https://survol.me
Apache License 2.0
142 stars 67 forks source link

Add other websites from the StackExchange network to the StackExchange implementation #110

Open mdolr opened 3 years ago

mdolr commented 3 years ago

Currently the StackExchange implementation only works for stackoverflow.com, it should work with any website that supports the stackexchange API.

To do this you should modify the dispatcher function in js/core.js and change the implementation in js/templates/stackexchange.js

dgnaegi commented 3 years ago

hi, i would like to do this one tomorrow :)

Can you assign me to this issue?

dgnaegi commented 3 years ago

Hi @mdolr thanks for assigning me and the well documented first issue :)

I opened a PR regarding this Issue: https://github.com/mdolr/survol/pull/114

Because the Stackexchange-API requires a site (e.g. physics) i replaced the getDomain() method with a getSite() method. I would appreciate a review.

grafik
mdolr commented 3 years ago

Ok I might have not been clear enough in the issue, I was expecting you to find a way to include every site from the stackexchange network which means everything listed here as the stackexchange network operates on multiple domains. There might be an API call that we could fire when the extension starts to get every domain from the stackexchange network and then use that.

It seems we can get a list of stackexchange websites using GET /sites. This would have to be done at the start of the extension in the background script I guess

mdolr commented 3 years ago

This is already ok-ish as most of the domains are [something].stackexchange.com and I'll merge this if it's not possible to include everything, but it would save us some time in the future if they open a new website like superuser.com for example, we wouldn't have to add it manually.

dgnaegi commented 3 years ago

Ok, thanks for further explaination. I'll try to find an universal solution during the next 2-3 days