<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel rdf:about="https://let.hatelabo.jp/sky-y/rss">
    <link>https://let.hatelabo.jp/sky-y/rss</link>
    <description></description>
    <title>Bookmarklets from sky-y</title>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://let.hatelabo.jp/sky-y/let/hLHX1fWUk9wB"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://let.hatelabo.jp/sky-y/let/hLHX1fWUk9wB">
    <link>https://let.hatelabo.jp/sky-y/let/hLHX1fWUk9wB</link>
    <dc:date>2017-09-23T15:19:34Z</dc:date>
    <description>iOS11からデフォルトのカメラでQRCodeを読み込めるようになったので</description>
    <dc:creator>sky-y</dc:creator>
    <title>[Let] 見ているページのURLをQRCode表示する</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Fsky-y%2Flet%2FhLHX1fWUk9wB.bookmarklet.js%20%28arg%29%22.replace%28%2F%28%5CS%2B%29%5Cs%2B%28%5CS%2A%29%2F%2Cfunction%28s%2Curl%2Carg%29%7Bs%3Ddocument.createElement%28%22script%22%29%3Bs.charset%3D%22utf-8%22%3Bs.src%3Durl%2B%22%3Fs%3D%22%2BencodeURIComponent%28arg%29%3Bdocument.body.appendChild%28s%29%7D%29%3Bvoid%280%29%3B"&gt;見ているページのURLをQRCode表示する&lt;/a&gt;&lt;pre&gt;/*
 * @title 見ているページのURLをQRCode表示する
 * @description iOS11からデフォルトのカメラでQRCodeを読み込めるようになったので
 * @include http://*
 * @license MIT License 
 */


javascript:(function(){
  var idname = 'qrplaceholder';
  var createPlaceholder = function(){
    var c = document.createElement('div');
    c.style.width = '100%25';
    c.style.height = '100%25';
    c.style.position = 'fixed';
    c.style.display = 'flex';
    c.style.top = '0';
    c.style.backgroundColor = 'rgba(0, 0, 0, 0.1)';
    c.zIndex = 10000;
    c.onclick = function(){
      document.body.removeChild(c);
    };
    var d = document.createElement('div');
    d.id = idname;
    d.style.width = '266px';
    d.style.height = '266px';
    d.style.marginTop = '10px';
    d.style.zIndex = 9999;
    d.style.margin = 'auto';
    c.appendChild(d);
    document.body.appendChild(c);
  };

  var showSvg = function(){
    try {
      var qrcode = new QRCode({
        content: window.location.href,
        width: 256,
        height: 256,
        padding: 4
      });
      document.getElementById(idname).innerHTML = qrcode.svg();
    }
    catch (e) {
      alert(e.message);
    }
  };

  var loadJS = function(onload){
    var s = document.createElement('script');
    document.head.appendChild(s);
    s.onload = onload;
    s.src = '//papnkukn.github.io/qrcode-svg/javascripts/qrcode.js';
  };

  loadJS(function(){
    createPlaceholder();
    showSvg();
  });
})()&lt;/pre&gt;</content:encoded>
  </item>
</rdf:RDF>
