digitalmethodsinitiative / zeeschuimer

A browser extension to collect social media data with.
Other
184 stars 14 forks source link

Send data to 4CAT behind a web server in a subfolder structure (i.e. example.com/4cat) #38

Open rahcor opened 3 months ago

rahcor commented 3 months ago

When 4CAT is behind a web server in a subfolder structure (i.e. example.com/4cat), the line 96 of interface.js ignores what is after the '/', thus Zeeschuimer throw an 404 error trying to connect to the 4cat API. A temporary solution is to open the web browser console and manually set the variable: background.browser.storage.local.set({'4cat-url': 'https://example.com/4cat'})

stijn-uva commented 2 months ago

Hi @rahcor, the rationale for ignoring the path after the domain name is that this is more fool-proof in situations where 4CAT is actually hosted at a (sub)domain - people can just copy and paste any 4CAT URL and Zeeschuimer will be able to reconstruct the relevant API endpoint URL from it. In our own practice we've seen that this makes a significant difference for how many people get stuck trying to upload their data to 4CAT.

I do take your point that this does not work properly when 4CAT is hosted at a sub-folder. Unfortunately it's not straightforward to reconcile the aforementioned flexibility with this. I'll have a think about whether and how we can do so...