<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/xml.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>nulog, NULL::something : out of the headphone &gt; 2006 &gt; August &gt; 20 &gt; dll 関数の補足と TODO</title>
  <link href="http://lowreal.net/logs/2006/08/20/1"/>
  <icon>http://lowreal.net/img/banner.png</icon>
  <link rel="self" type="application/atom+xml" href="http://lowreal.net/logs/2006/08/20/1.atom"/>
  <link rel="alternate" type="application/xhtml+xml" href="http://lowreal.net/logs/2006/08/20/1.xhtml"/>
  <updated>2006-08-20T16:49:40+09:00</updated>
  <author>
    <name>cho45(砂糖)</name>
  </author>
  <id>http://lowreal.net/2006/08/20/1</id>
  <entry>
    <title>dll 関数の補足と TODO</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2006/08/20/1.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2006/08/20/1.xhtml"/>
    <updated>2006-08-20T16:49:40+09:00</updated>
    <published>2006-08-20T16:49:40+09:00</published>
    <id>http://lowreal.net/2006/08/20/1</id>
    <category term="js"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><a href="http://lowreal.net/logs//2006/08/12/1">dll 関数</a> の補足と覚書</p>
        <p>GM_xmlhttprequest の onload でなんで .call とかやっているかというと、一部ライブラリが this を window (Global) と仮定したコードになっているからです。eval のコンテキストの this を window (Global) オブジェクトにしてあげて、例えば MochiKit の export 先オブジェクトをそこにしてあげているわけです。</p>
        <p>でもって、なぜ unsafeWindow でなく window なのかっていうのは、その export された関数とかが、ロードされたページに影響を及ぼさないためです。Greasemonkey 中の window はページ内のスクリプトからはアクセスできない (safe) ので、Greasemonkey 内限定で使う場合、副作用の懸念を減らすことができます。</p>
        <hr/>
        <p>でもって、<a href="http://d.hatena.ne.jp/brazil/20060820/1156022719">id:brazil さんの記事</a> で、あああって思った。全部とってきてから eval したら、変に何回もリクエスト送らないでいいや。と、いう、か、GM_setValue 使えばいいんだけど、ちょっと GM_setValue で長い文字列突っ込むのは怖い。</p>
      </div>
    </content>
  </entry>
</feed>
