snapshot page in background, full-auto when use as UserScript
/*
* @title spycam
* @description snapshot page in background, full-auto when use as UserScript
* @include http://example.com/DIY/*
* @include https://example.com/DIY/*
* @license MIT License http://opensource.org/licenses/MIT
* @javascript_url
*/
// Wayback Machine (aka Web Archive, Internet Archive) ver by taizooo
// http://let.hatelabo.jp/taizooo/let/hLHVhMjlxZ5H
// came and go archive.is
// http://let.hatelabo.jp/noromanba/let/hJmdy-H20OA0
// ATTENTION
// if you use as UserScript, add user-based @include DO IT YOUR SELF
// why did not use globally matches (@include http://* @include https://* @include *)
// because highly insecure, probable violate your rights. AT YOUR OWN RISK
(function () {
// c.f. official "BOOKMARKLET:" on https://archive.is/
var STORAGE = 'https://archive.is/?run=1&url=';
// canonical
// http://let.hatelabo.jp/noromanba/let/hLHVzOTQjfYH
// https://gist.github.com/noromanba/d730ccf3ae5e6916cd60
var url = (document.head.querySelector('meta[property="og:url"][content]') || {}).content ||
(document.head.querySelector('link[rel="canonical"][href]') || {}).href ||
location.href;
/* IDKWTD didn't work img-method, POST: form src="https://archive.is/submit/"
document.createElement('img').src = STORAGE + encodeURIComponent(url);
/*/
var spy = document.createElement('iframe');
spy.src = STORAGE + encodeURIComponent(url);
spy.height = spy.width = 0; // TBD omit
spy.hidden = true;
spy.sandbox = [ // TBD omit
'allow-scripts',
'allow-forms',
'allow-same-origin'
].join(' ');
document.body.appendChild(spy);
//*/
})();