/*
* @title 2copylet
* @description show minified code on Hatena::Let when 2-exec; for copy of mobile
* @include http://let.hatelabo.jp/*
* @include http://let.st-hatelabo.com/*
* @contributor mino90 http://let.hatelabo.jp/mino90/let/gYC-xYDKx6O-dA (Fork of)
* @license MIT License http://opensource.org/licenses/MIT
* @javascript_url
*/
// single exec ver.
// http://let.hatelabo.jp/noromanba/let/hLHUzoez66cW
// needs execute twice
(() => {
if (location.hostname === 'let.hatelabo.jp') {
location.hostname = 'let.st-hatelabo.com';
return;
}
if (location.hostname === 'let.st-hatelabo.com') {
const iframe = document.body.querySelector('iframe[src^="http://let.st-hatelabo.com"]');
const raw = iframe.contentDocument.querySelector('a[href^="javascript:"]');
// TBD readonly textarea
const input = document.createElement('input');
input.style.position = 'absolute';
input.style.top = '0';
input.style.left = '0';
input.style.width = '50%';
input.type = 'text';
input.value = raw.href;
document.body.appendChild(input);
input.select();
}
})();