3 ms·
It would be cool if there was a javascript library that replaced broken links with Internet Archive version of the page if it exists. I guess it’s more complic
by mjgs 6y ago
It would be cool if there was a javascript library that replaced broken links with Internet Archive version of the page if it exists.
I guess it’s more complicated than just that because you’d have to take into account the date the page was originally linked to to get the closest match but should be doable.
There might very well be reasons this isn’t a good idea, it’s just something that occurred to me might be useful since I have a lot of old links and no doubt many of them are broken now.
- lgats 6y agoThis would not work for most links due to cross origin restrictions. You would also end up sending the validation request for every client page view
- mjgs 6y agoI was thinking that a service worker could be used: https://bitsofco.de/web-workers-vs-service-workers-vs-worklets/#service-workers https://bitsofco.de/web-workers-vs-service-workers-vs-workle... If the url returns a 404, check the internet archive, if it’s there then return that otherwise return a 404. If CORS is an issue just proxy the requests via the server that is serving the website.