keithjgrant / omnibear

A Micropub browser extension
MIT License
36 stars 8 forks source link

Allow to manually set micropub endpoint and token #37

Closed sknebel closed 6 years ago

sknebel commented 6 years ago

Inspired by discussion in #indieweb-dev today:

Since omnibear can really easily be run locally (as in, it always runs locally) it's a prime candidate to test micropub endpoints during development, running locally as well. Getting a token using online services can then be a bit tricky to set up. It would be helpful if one could set the micropub endpoint URL and token manually and totally avoid the discovery and authorization stage.

UI wise, I image in a "developer" or "advanced" option as an alternative to entering the homepage URL for the normal IndieAuth flow.

keithjgrant commented 6 years ago

That makes sense. Under the hood, Omnibear stores these values in localStorage, so if you can get to a debugger for the omnibear window (right-click -> Inspect in Chrome), you can manually set the needed localStorage keys in the browser console:

localStorage.setItem('token', tokenString);
localStorage.setItem('domain', 'http://yourdomain.com');
localStorage.setItem('micropubEndpoint', endpointUrl);

I’m pretty sure those three are the only keys you’d need. It also sets a tokenEndpoint and authEndpoint but I don’t think it would need those once the token is set.

keithjgrant commented 6 years ago

I probably won’t add this feature directly to the app, but I do want to document this in a developers.md (or similar) readme here in this repository.

sknebel commented 6 years ago

Would you accept a PR adding it?

keithjgrant commented 6 years ago

of course!

keithjgrant commented 6 years ago

Options added to the new settings page