keithjgrant / omnibear

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

Close authorization tab when authorization completed. #59

Closed Zegnat closed 6 years ago

Zegnat commented 6 years ago

I am not sure if this makes sense or not to do. But want to bring it up anyway.

Currently my endpoint does not answer to ?=syndicate-to, and there is no MUST for supporting such queries in the current Micropub spec. This is not an issue for Omnibear and just means it should not offer syndication options.

However, this throws an error from the micropub-helper in fetchSyndicationTargets. The browser then skip the .then() for closing the tab and goes straight into error reporting: https://github.com/keithjgrant/omnibear/blob/49e839146aef715f754837fa0a15901c73544b40/src/background.js#L65-L75

This confused me at first when I was debugging authorisation. All authorisation actions succeeded and Omnibear was usable, the tab just didn’t close.

Either chrome.tabs.remove should trigger in the catch(), or it should be moved up so the tab is closed prior to querying syndication targets.

keithjgrant commented 6 years ago

Should be easy enough to do in conjunction with #54

keithjgrant commented 6 years ago

Version 1.1.0 is publishing now to Chrome & Firefox stores. This should resolve this issue.