machawk1 / Mink

Chrome extension that uses Memento to indicate that a page a user is viewing on the live web has an archived copy and to give the user access to the copy
MIT License
49 stars 3 forks source link

Cached TimeMaps are listed for mementos visited on options page #280

Open machawk1 opened 5 years ago

machawk1 commented 5 years ago

This is due to mentos themselves having "TimeMaps" in the Link header. Mink associates the information in this header with the URI-M. This caching might subsequently involve navigation, so we cannot simply exclude it from being added to localStorage, as it might be tied into other parts of the current implementation.

We could flag it in the UI to not be displayed but still use the information under-the-hood. Future work might be to disassociate the TMs retained from URI-Ms with the representation at actual URI-Ts.

https://github.com/machawk1/Mink/blob/ff8d0ef5b530fd12fdaf9fd8f06e94122ecbf819/mink-plugin/content.js#L168-L178

machawk1 commented 5 years ago

Commenting out:

          //chrome.runtime.sendMessage({
          //  method: 'setTimemapInStorageAndCall', tm: tm, url: document.URL
          //})

or not executing this conditional will prevent the entry from being inserted into localStorage and thus it won't appear in the dropdown on the options page. This is the wrong approach to take.

machawk1 commented 5 years ago

Additional caveat: selecting the URI-M entry in the options dropdown for cached TMs produces an exception, as however we are storing it in localStorage is malformed compared to how TMs for URI-Rs are stored.