<?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/utgwkk/rss">
    <link>https://let.hatelabo.jp/utgwkk/rss</link>
    <description></description>
    <title>Bookmarklets from utgwkk</title>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/joWrgOz-geAA"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/ipHsrdSkgsAA"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/ionI8KyygYAA"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/hLHXsfDVl88C"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/g5G2-a-v3Jg2"/>
        <rdf:li rdf:resource="https://let.hatelabo.jp/utgwkk/let/hJme1PXarKVG"/>
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/joWrgOz-geAA">
    <link>https://let.hatelabo.jp/utgwkk/let/joWrgOz-geAA</link>
    <dc:date>2022-08-24T02:25:11Z</dc:date>
    <description>imgタグのalt属性が未指定の要素を赤くハイライトします。指定されていたら緑色でハイライトします。一度実行したら要素が動的に変わってもハイライトされます</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] 代替テキストが指定されていないimg要素をハイライトする</title>
    <content:encoded>&lt;a href="javascript:%22https%3A%2F%2Flet.st-hatelabo.com%2Futgwkk%2Flet%2FjoWrgOz-geAA.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;代替テキストが指定されていないimg要素をハイライトする&lt;/a&gt;&lt;pre&gt;/*
 * @title 代替テキストが指定されていないimg要素をハイライトする
 * @description imgタグのalt属性が未指定の要素を赤くハイライトします。指定されていたら緑色でハイライトします。一度実行したら要素が動的に変わってもハイライトされます
 * @include https://*
 * @license MIT License
 * @require 
 */
(() =&amp;gt; {
  const highlight = (element) =&amp;gt; {
    element.querySelectorAll(&amp;quot;img&amp;quot;).forEach((img) =&amp;gt; {
      // alt属性が指定されていたら緑の線、指定されていないなら赤線で囲まれる
      img.style.outline = img.getAttribute('alt') !== null ? &amp;quot;1px solid green&amp;quot; : &amp;quot;2px solid red&amp;quot;
    })
  }
  highlight(document.body)
  const observer = new MutationObserver((ms) =&amp;gt; {
    ms.forEach((m) =&amp;gt; {
      m.addedNodes.forEach((node) =&amp;gt; {
        if (!(node instanceof HTMLElement)) {
          return
        }
        highlight(node)
      })
    })
  })
  observer.observe(document.body, { childList: true, subtree: true })
})()&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/ipHsrdSkgsAA">
    <link>https://let.hatelabo.jp/utgwkk/let/ipHsrdSkgsAA</link>
    <dc:date>2020-07-09T03:13:33Z</dc:date>
    <description>[URL:title=タイトル]という形式でページのタイトルとURLをpromptします</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] はてな記法でタイトルとURLをprompt</title>
    <content:encoded>&lt;a href="javascript:%28function%28%29%7Bconst%20content%3D%60%5B%24%7Blocation.href%7D%3Atitle%3D%24%7Bdocument.title%7D%5D%60%3Bprompt%28%27%27%2Ccontent%29%7D%29%28%29%3B"&gt;はてな記法でタイトルとURLをprompt&lt;/a&gt;&lt;pre&gt;/*
 * @title はてな記法でタイトルとURLをprompt
 * @description [URL:title=タイトル]という形式でページのタイトルとURLをpromptします
 * @include *
 * @license MIT License
 * @javascript_url
 */
(function(){
 const content = `[${location.href}:title=${document.title}]`;
 prompt('', content);
 // これは動かない
 // copy(content)
})();&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/ionI8KyygYAA">
    <link>https://let.hatelabo.jp/utgwkk/let/ionI8KyygYAA</link>
    <dc:date>2020-06-26T06:37:49Z</dc:date>
    <description>[タイトル](URL)という形式でページのタイトルとURLをalertします</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] Markdownのリンク形式でタイトルとURLをalert</title>
    <content:encoded>&lt;a href="javascript:%28function%28%29%7Bconst%20content%3D%22%5B%22%2Bdocument.title%2B%22%5D%28%22%2Blocation.href%2B%22%29%22%3Balert%28content%29%7D%29%28%29%3B"&gt;Markdownのリンク形式でタイトルとURLをalert&lt;/a&gt;&lt;pre&gt;/*
 * @title Markdownのリンク形式でタイトルとURLをalert
 * @description [タイトル](URL)という形式でページのタイトルとURLをalertします
 * @include *
 * @license MIT License
 * @javascript_url
 */
(function(){
 const content = &amp;quot;[&amp;quot; + document.title + &amp;quot;](&amp;quot; + location.href + &amp;quot;)&amp;quot;;
 alert(content);
 // これは動かない
 // copy(content)
})();&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/hLHXsfDVl88C">
    <link>https://let.hatelabo.jp/utgwkk/let/hLHXsfDVl88C</link>
    <dc:date>2019-10-03T07:27:04Z</dc:date>
    <description>[タイトル URL]という形式でページのタイトルとURLをalertします</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] Scrapboxのリンク形式でタイトルとURLをalert</title>
    <content:encoded>&lt;a href="javascript:%28function%28%29%7Bconst%20content%3D%22%5B%22%2Bdocument.title%2B%22%20%22%2Blocation.href%2B%22%5D%22%3Balert%28content%29%7D%29%28%29%3B"&gt;Scrapboxのリンク形式でタイトルとURLをalert&lt;/a&gt;&lt;pre&gt;/*
 * @title Scrapboxのリンク形式でタイトルとURLをalert
 * @description [タイトル URL]という形式でページのタイトルとURLをalertします
 * @include *
 * @license MIT License
 * @javascript_url
 */
(function(){
 const content = &amp;quot;[&amp;quot; + document.title + &amp;quot; &amp;quot; + location.href + &amp;quot;]&amp;quot;;
 alert(content);
 // これは動かない
 // copy(content)
})();&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/g5G2-a-v3Jg2">
    <link>https://let.hatelabo.jp/utgwkk/let/g5G2-a-v3Jg2</link>
    <dc:date>2019-07-07T06:17:37Z</dc:date>
    <description>YouTubeの動画の現在位置のスクリーンショットを撮って、新しいタブに表示します。</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] YouTubeの動画のスクショを撮る</title>
    <content:encoded>&lt;a href="javascript:%28%28%29%3D%3E%7Bconst%20query%3D%27.video-stream.html5-main-video%27%3Bconst%20video%3Ddocument.querySelector%28query%29%3Bconst%20canvas%3Ddocument.createElement%28%27canvas%27%29%3Bcanvas.width%3DparseInt%28video.style.width%2C10%29%7C%7C960%3Bcanvas.height%3DparseInt%28video.style.height%2C10%29%7C%7C540%3Bconst%20ctx%3Dcanvas.getContext%28%272d%27%29%3Bctx.drawImage%28video%2C0%2C0%2Ccanvas.width%2Ccanvas.height%29%3Bconst%20url%3Dcanvas.toDataURL%28%27application%2Foctet-stream%27%29%3Bconst%20newWindow%3Dwindow.open%28%27about%3Ablank%27%29%3BnewWindow.document.write%28%60%3Cimg%20src%3D%22%24%7Burl%7D%22%3E%60%29%7D%29%28%29%3B"&gt;YouTubeの動画のスクショを撮る&lt;/a&gt;&lt;pre&gt;/*
 * @title YouTubeの動画のスクショを撮る
 * @description YouTubeの動画の現在位置のスクリーンショットを撮って、新しいタブに表示します。
 * @include https://www.youtube.com/*
 * @license MIT License
 * @javascript_url
 */
(() =&amp;gt; {
    const query = '.video-stream.html5-main-video';
    const video = document.querySelector(query);
    const canvas = document.createElement('canvas');
    canvas.width = parseInt(video.style.width, 10) || 960;
    canvas.height = parseInt(video.style.height, 10) || 540;
    const ctx = canvas.getContext('2d');
    ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
    const url = canvas.toDataURL('application/octet-stream');
    const newWindow = window.open('about:blank');
    newWindow.document.write(`&amp;lt;img src=&amp;quot;${url}&amp;quot;&amp;gt;`);
})()&lt;/pre&gt;</content:encoded>
  </item>
  <item rdf:about="https://let.hatelabo.jp/utgwkk/let/hJme1PXarKVG">
    <link>https://let.hatelabo.jp/utgwkk/let/hJme1PXarKVG</link>
    <dc:date>2019-07-07T05:49:57Z</dc:date>
    <description>Subsonic の #nowplaying を生成してツイートする</description>
    <dc:creator>utgwkk</dc:creator>
    <title>[Let] subsonic-nowplaying</title>
    <content:encoded>&lt;a href="javascript:%28%28%29%3D%3E%7Bconst%20d%3Ddocument.getElementById%28%27playQueue%27%29.contentWindow.document%3Bconst%20sn%3Dd.getElementById%28%27songName%27%29.textContent%3Bconst%20ar%3Dd.getElementById%28%27artistName%27%29.textContent%3Bwindow.open%28%27https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Ftext%3D%27%2BencodeURI%28%60%3F%20%24%7Bsn%7D%20by%20%24%7Bar%7D%60%29%2B%27%26hashtags%3Dnowplaying%27%2C%27hoge%27%2C%27width%3D800%2C%20height%3D300%2C%20menubar%3Dno%2C%20toolbar%3Dno%2C%20scrollbars%3Dyes%27%29%7D%29%28%29%3B"&gt;subsonic-nowplaying&lt;/a&gt;&lt;pre&gt;/*
 * @title subsonic-nowplaying
 * @description Subsonic の #nowplaying を生成してツイートする
 * @include http://*
 * @license MIT License
 * @require 
 * @javascript_url
 */

(() =&amp;gt; {
const d = document.getElementById('playQueue').contentWindow.document;
const sn = d.getElementById('songName').textContent;
const ar = d.getElementById('artistName').textContent;
window.open('https://twitter.com/intent/tweet?text='+encodeURI(`? ${sn} by ${ar}`) + '&amp;amp;hashtags=nowplaying', 
            'hoge', 'width=800, height=300, menubar=no, toolbar=no, scrollbars=yes');
})();&lt;/pre&gt;</content:encoded>
  </item>
</rdf:RDF>
