tag:crieit.net,2005:https://crieit.net/tags/%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/feed 「ブックマークレット」の記事 - Crieit Crieitでタグ「ブックマークレット」に投稿された最近の記事 2019-10-26T04:35:45+09:00 https://crieit.net/tags/%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/feed tag:crieit.net,2005:PublicArticle/15505 2019-10-26T04:35:45+09:00 2019-10-26T04:35:45+09:00 https://crieit.net/posts/Wayback-Machine-POST Wayback Machineに今のサイトをPOSTして登録するブックマークレット <p>Wayback Machine(<a target="_blank" rel="nofollow noopener" href="https://web.archive.org">https://web.archive.org</a>)に開いているサイトを一発で登録するブックマークレットを作りました。<br /> オプションの「Save outlinks」「Save error pages (HTTP Status=4xx, 5xx)」「Save screen shot」は全てオンにした状態です。</p> <pre><code class="javascript">javascript: (function() { var form = document.createElement('form'); form.action = 'https://web.archive.org/save'; form.method = 'post'; form.target = '_blank'; form.id = 'wmbl'; var hid = document.createElement('input'); hid.type = 'hidden'; hid.name = 'url'; hid.value = document.location; form.appendChild(hid); var hid2 = document.createElement('input'); hid2.type = 'hidden'; hid2.name = 'capture_outlinks'; hid2.value = 'on'; form.appendChild(hid2); var hid3 = document.createElement('input'); hid3.type = 'hidden'; hid3.name = 'capture_all'; hid3.value = 'on'; form.appendChild(hid3); var hid4 = document.createElement('input'); hid4.type = 'hidden'; hid4.name = 'capture_screenshot'; hid4.value = 'on'; form.appendChild(hid4); document.body.appendChild(form); document.getElementById('wmbl').submit(); } )(); </code></pre> <p>縮小版</p> <pre><code class="javascript">javascript:(function(){var c=document.createElement("form");c.action="https://web.archive.org/save";c.method="post";c.target="_blank";c.id="wmbl";var b=document.createElement("input");b.type="hidden";b.name="url";b.value=document.location;c.appendChild(b);var a=document.createElement("input");a.type="hidden";a.name="capture_outlinks";a.value="on";c.appendChild(a);var e=document.createElement("input");e.type="hidden";e.name="capture_all";e.value="on";c.appendChild(e);var d=document.createElement("input");d.type="hidden";d.name="capture_screenshot";d.value="on";c.appendChild(d);document.body.appendChild(c);document.getElementById("wmbl").submit()})(); </code></pre> <p>こちらを参考に作りました。<br /> <a target="_blank" rel="nofollow noopener" href="https://q.hatena.ne.jp/1213176191">https://q.hatena.ne.jp/1213176191</a></p> <p>汎用的に使えるようになってますので、サーバーにPOSTする系のブックマークレットを作りたくなったときは<code>value</code>などを改変して使ってください。</p> <p>ちなみに書いてから調べて知りましたが、昔の仕様の名残りでWayback Machineは/save/の下に直接URLを貼っても登録できるようです。オプションはどうなってるんだろう…。</p> <pre><code class="javascript">javascript:var u=location.href;w='http://web.archive.org/save/'+u;window.open(w, null); </code></pre> <p>引用元:<a target="_blank" rel="nofollow noopener" href="http://blog.tainakanchu.pw/article/waybackbookmarklet.html">http://blog.tainakanchu.pw/article/waybackbookmarklet.html</a></p> <p><a target="_blank" rel="nofollow noopener" href="http://archive.is">archive.is</a>も簡単に登録できます。(公式ブックマークレットがあります。)</p> <pre><code class="javascript">javascript:void(open('http://archive.today/?run=1&url='+encodeURIComponent(document.location))) </code></pre> <p>以上です!</p> ウラル