dessant / web-archives

Browser extension for viewing archived and cached versions of web pages, available for Chrome, Edge and Safari
https://apps.apple.com/us/app/web-archives-for-safari/id1603181853
GNU General Public License v3.0
1.22k stars 90 forks source link

Display Web Archives popup on 404 error #24

Open ghost opened 4 years ago

ghost commented 4 years ago

This isn't a big deal, but it would be nice to have an option to automatically display a popup with archive options when you arrive at a 404 page or similar. I could see myself forgetting about this extension and giving up on a broken page otherwise. Plus, it would just be a little quicker and more convenient. Here's what I'm imagining:

ArchiveMockup
dessant commented 4 years ago

There's an option in the Firefox version of the extension, Show in address bar on server error, which shows the page action icon in the address bar on these status codes.

Screenshot from 2020-11-09 23-05-38

This was done because depending on the error, it is not always possible to inject a content script with a popup in the page, and the browser action can't be automatically opened either using the extension API, so this was the easiest compromise to still indicate that there's an action the user can take.

Your suggestion is great, and we could add it to progressively enhance the feature by showing a popup when the option is enabled and the tab content allows script injection, and falling back to the address bar icon if the popup cannot be shown.

ghost commented 4 years ago

That Firefox address bar feature is pretty cool. It seems like Chrome removed that a while ago, though.

I'm guessing that chrome.browserAction.setIcon wouldn't work either in that case? Still, any indication (even if it doesn't work on all pages) would be a nice addition.

dessant commented 4 years ago

I think the issue was that a pageAction (used for the address bar icon) and browserAction icon could not be shown at the same time in Chrome, it has returned an error. We can use a popup on all platforms when the page content allows it, and fall back to a page action in browsers that support showing both types of actions at the same time, or update the browser action icon as a last resort.