web魚拓
Googleがキャッシュを保存しなくなってしまった
waybac machineは挙動が重い
分散型の魚拓ってのはないのかな
分散型にすると何がいいか
自分の欲しいものを分散して保存できる
それがいくらニッチでも
お金以外で貢献できる
サーバーの設置とか
自分の欲しいものを公開した誰でも使えるようにするのと何違うか
魚拓をブラウザから簡単に呼び出す
404やエラーコードでトリガ
Get current page http status from javascript - Stack Overflow
PerformanceResourceTiming: responseStatus property - Web APIs | MDN
これを使えば可能
https://gyazo.com/268130ea5e653b73cc3593de5548685f
こんな感じ
code:back.js
(function() {
'use strict';
// パフォーマンスAPIから navigation エントリを取得
const navigationData = window.performance.getEntries().find(e => e.entryType === "navigation");
// navigationDataが存在し、responseStatusが200以外の場合のみ実行
if (navigationData && navigationData.responseStatus !== 200) {
// バナー要素を作成
const banner = document.createElement('div');
banner.id = 'custom-banner';
banner.innerHTML = `
<a href="https://web.archive.org/web/${window.location.href}" target="_blank" style="text-decoration: none; color: inherit;">
<div style="
background: linear-gradient(to right, #FF5252, #E53935);
color: white;
text-align: center;
padding: 15px 0;
font-size: 1.2em;
font-weight: bold;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
cursor: pointer;
font-family: Arial, sans-serif;
">
🚀 今すぐチェック!昔のページへ 🚀
</div>
</a>
`;
// ページの最上部に挿入
document.body.insertBefore(banner, document.body.firstChild);
}
})();
safariは非対応
https://gyazo.com/1c23358e333dfa5febe14bcded732796
基本的にレスポンスコードはhttpの仕様で、html層からは見えない
サーバーの時点では見えるが
なんてこった
https://web.archive.org/web/で魚拓の最新を開く