<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>七星庐 &#187; 浏览器</title>
	<atom:link href="http://qixinglu.com/category/browser/feed" rel="self" type="application/rss+xml" />
	<link>http://qixinglu.com</link>
	<description>潜心修炼，早日成仙。GNU/Linux、Ubuntu、Firefox、LiveCD、游戏MOD。</description>
	<lastBuildDate>Tue, 27 Jul 2010 11:38:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>给Google Image Proxy加个自动运行功能</title>
		<link>http://qixinglu.com/archives/google_image_proxy_interval_run?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google_image_proxy_interval_run</link>
		<comments>http://qixinglu.com/archives/google_image_proxy_interval_run#comments</comments>
		<pubDate>Sat, 03 Jul 2010 09:02:21 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[Proxy]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2632</guid>
		<description><![CDATA[之前写了个Google Image Proxy脚本，几行代码很实用，不过只在Greasemonkey是在页面在入后运行一次结束了，所以对于使用AJAX来动态更新的内容就无效了，比如说Google Reader，除非手动再运行一次，可以使用Bookmarklet或者Firegestures手势。 如果次数过多，手动运行比较麻烦的，如果能自动运行就好了，这样Google Reader除了视频外，文字和图片都能浏览，也能算半个代理了。想起我用的另一个google reader full feed changer有自动更新的能力，看了一下它的源代码，原理很简单，就是让页面每隔一定时间重新执行一次代码，想到另一个方法是对切换阅读条目相关对象加入事件处理，不过Google的代码混淆过，调试起来非常麻烦，所以还是用前者的方法。 新版的代码已经更新，默认已经加进对Google Reader自动运行支持，只要你在Greasemonkey加入Google Reader匹配网址“https://www.google.com/reader/view/?*”就行了。 当然我没有把代码写死，允许你添加其它网址和设置，在代码的开头有三个大写字母的变量 var INTERVAL_RUN_TIME = 5000 var INTERVAL_RUN_KEY = &#34;i&#34; var INTERVAL_RUN_URLS = &#91; //[match string, select type(0:id,1:class,2:tag), select string] &#91;&#34;www.google.com/reader/view/&#34;, 0, &#34;current-entry&#34;&#93; //[&#34;www.google.com/reader/view/&#34;, 1, &#34;entry&#34;] //[&#34;www.google.com/reader/view/&#34;, 2, &#8230; <a href="http://qixinglu.com/archives/google_image_proxy_interval_run">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>之前写了个<a href="http://qixinglu.com/archives/google_image_proxy">Google Image Proxy</a>脚本，几行代码很实用，不过只在Greasemonkey是在页面在入后运行一次结束了，所以对于使用AJAX来动态更新的内容就无效了，比如说Google Reader，除非手动再运行一次，可以使用Bookmarklet或者Firegestures手势。</p>
<p>如果次数过多，手动运行比较麻烦的，如果能自动运行就好了，这样Google Reader除了视频外，文字和图片都能浏览，也能算半个代理了。想起我用的另一个<a href="http://userscripts.org/scripts/show/19949">google reader full feed changer</a>有自动更新的能力，看了一下它的源代码，原理很简单，就是让页面每隔一定时间重新执行一次代码，想到另一个方法是对切换阅读条目相关对象加入事件处理，不过Google的代码混淆过，调试起来非常麻烦，所以还是用前者的方法。<span id="more-2632"></span></p>
<p>新版的代码<a href="http://userscripts.org/scripts/show/68761">已经更新</a>，默认已经加进对Google Reader自动运行支持，只要你在Greasemonkey加入Google Reader匹配网址“https://www.google.com/reader/view/?*”就行了。</p>
<p>当然我没有把代码写死，允许你添加其它网址和设置，在代码的开头有三个大写字母的变量</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> INTERVAL_RUN_TIME <span style="color: #339933;">=</span> <span style="color: #CC0000;">5000</span>
<span style="color: #003366; font-weight: bold;">var</span> INTERVAL_RUN_KEY <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;i&quot;</span>
<span style="color: #003366; font-weight: bold;">var</span> INTERVAL_RUN_URLS <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
    <span style="color: #006600; font-style: italic;">//[match string, select type(0:id,1:class,2:tag), select string]</span>
    <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;www.google.com/reader/view/&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;current-entry&quot;</span><span style="color: #009900;">&#93;</span>
    <span style="color: #006600; font-style: italic;">//[&quot;www.google.com/reader/view/&quot;, 1, &quot;entry&quot;]</span>
    <span style="color: #006600; font-style: italic;">//[&quot;www.google.com/reader/view/&quot;, 2, &quot;table&quot;]</span>
<span style="color: #009900;">&#93;</span></pre></div></div>

<p>意义如下</p>
<ul>
<li>“INTERVAL_RUN_TIME”是自动执行的间隔时间，单位是毫秒，5000表示每隔5秒钟执行一次。</li>
<li>“INTERVAL_RUN_KEY”表示启用和禁用自动执行功能的热键，默认是“i”</li>
<li>“INTERVAL_RUN_URLS”是自动启用自动执行的网址列表，每组三个参数，分别是匹配的网址（部分匹配）、选择器类型（1、2、3分别是id，class、tag）、选择的字符串。</li>
</ul>
<p>比如这行</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;www.google.com/reader/view/&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;current-entry&quot;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>表示当网址中有“www.google.com/reader/view/”字符串时，没过5秒对“id=current-entry”的节点执行图片地址替换代码。</p>
<p>其实选择器类型就是对应“getElementById()”，“getElementsByClassName()”，“getElementsByTagName()”的使用。如果你不知道要填什么，可以选择“body”这个tag，比如</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;the_url_sring&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>热键“i”对任何页面都适用，不管你有没有在“INTERVAL_RUN_URLS”变量里设置，随时可以通过热键来启用和禁用自动执行功能。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/google_image_proxy_interval_run/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Reader的搜索界面优化</title>
		<link>http://qixinglu.com/archives/google_reader_search_ui_optimization?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google_reader_search_ui_optimization</link>
		<comments>http://qixinglu.com/archives/google_reader_search_ui_optimization#comments</comments>
		<pubDate>Tue, 11 May 2010 00:15:53 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Reader]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[stylish]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2441</guid>
		<description><![CDATA[还是受不了Google Reader搜索界面那蹩脚的设计，下拉框选择要搜索的feed，这个下拉框高度才13行，我订阅了150+条feed，要在这么短的视图里找要搜索的feed还真令人烦躁。虽然那个按钮可以输入关键字过滤，但只是开头匹配。 用CSS来调整 用Stylish的加入下面CSS样式，把显示条数多加几行。 #search-restrict-button .goog-menu &#123; max-height: 800px !important; &#125; 后来觉得加宽和多列显示更好，宽屏用不错，高宽和列数根据分辨率自己改。 #search-restrict-button .goog-menu &#123; max-height: 768px !important; width: 1024px!important; -moz-column-count: 4 !important; &#125; 效果如下 上面的代码已经加到我在用的Stylish样式中，顺便把“你关注的对象”一栏高度设为自动（即显示全部好友，不会出现滚动条） 添加一个搜索当前feed的按钮 用css来扩大显示面积还是要用眼神去搜索，其实我最常用的是在当前的feed中搜索，看feed的地址为 https://www.google.com/reader/view/?hl=zh-CN&#38;tab=wy#stream/feed地址 搜索地址为 https://www.google.com/reader/view/?hl=zh-CN&#38;tab=wy#search/搜索关键词//feed地址 也就是说直接修改地址栏把“#stream”替换成“#search/搜索关键词/”来进入搜索页面，比用那下拉框找选择feed再点击搜索按钮要快得多。 不过手动改也是比较麻烦的，于是写个Greasemonkey脚本，添加一个搜索按钮，点击这个搜索按钮就在当前的feed搜索。]]></description>
			<content:encoded><![CDATA[<p>还是受不了Google Reader搜索界面那蹩脚的设计，下拉框选择要搜索的feed，这个下拉框高度才13行，我订阅了150+条feed，要在这么短的视图里找要搜索的feed还真令人烦躁。虽然那个按钮可以输入关键字过滤，但只是开头匹配。</p>
<h3>用CSS来调整</h3>
<p>用Stylish的加入下面CSS样式，把显示条数多加几行。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#search-restrict-button</span> <span style="color: #6666ff;">.goog-menu</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">max-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">800px</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>后来觉得加宽和多列显示更好，宽屏用不错，高宽和列数根据分辨率自己改。<span id="more-2441"></span></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#search-restrict-button</span> <span style="color: #6666ff;">.goog-menu</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">max-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">768px</span> !important<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1024px</span>!important<span style="color: #00AA00;">;</span>
    -moz-column-count<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">4</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>效果如下</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2F2010%2Fgoogle_reader_search_ui_optimization.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="加长高度和分列显示" /></p>
<p>上面的代码已经加到我在用的<a href="http://userstyles.org/styles/22618">Stylish样式</a>中，顺便把“你关注的对象”一栏高度设为自动（即显示全部好友，不会出现滚动条）</p>
<h3>添加一个搜索当前feed的按钮</h3>
<p>用css来扩大显示面积还是要用眼神去搜索，其实我最常用的是在当前的feed中搜索，看feed的地址为</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">https://www.google.com/reader/view/?hl=zh-CN&amp;tab=wy#stream/feed地址</pre></div></div>

<p>搜索地址为</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">https://www.google.com/reader/view/?hl=zh-CN&amp;tab=wy#search/搜索关键词//feed地址</pre></div></div>

<p>也就是说直接修改地址栏把“#stream”替换成“#search/搜索关键词/”来进入搜索页面，比用那下拉框找选择feed再点击搜索按钮要快得多。</p>
<p>不过手动改也是比较麻烦的，于是写个<a href="http://userscripts.org/scripts/show/76367">Greasemonkey脚本</a>，添加一个搜索按钮，点击这个搜索按钮就在当前的feed搜索。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2F2010%2Fgoogle_reader_search_ui_optimization_1.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="用于搜索当前feed的按钮" /></p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/google_reader_search_ui_optimization/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Firefox在301重定向下地址栏不更新问题</title>
		<link>http://qixinglu.com/archives/firefox_301_redirect_location_bar_not_update?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=firefox_301_redirect_location_bar_not_update</link>
		<comments>http://qixinglu.com/archives/firefox_301_redirect_location_bar_not_update#comments</comments>
		<pubDate>Thu, 06 May 2010 02:02:05 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[FireGestures]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2423</guid>
		<description><![CDATA[虽然这个是小问题，还是有点不爽的，必须解决一下。标题的意思是，如果Firefox收到301重定向（短链接就是这样做的），跟随并打开新网页，如果出现网络错误（最常的就是被重置啦），显示了错误页面，而地址栏还是旧地址，而不是重定向后的新地址。 具体情况是，在Twitter上有不少人在分享极不河蟹的链接，一般都是缩短过的。比如用google“温习”，用TinyURL缩短后这个链接，你会发现TinyURL被重置了，其实是google被重置，只是Firefox地址栏没有更新而已。问题就在这里，Firefox就显示一个错误页面，没有任何原始地址信息，想修改也不行。不知道原始地址是什么，加进代理列表里就有点麻烦，得手动去展开，或许这个地址改成https协议就能浏览了。 更新：囧死，原来在当前标签页打开就会更新的，中键或粘贴到新标签页打开就不会更新，如果链接里有“target=&#8221;_blank&#8221;”来打开新标签页也是会更新的，测试一下。 还是找个解决方法吧，还是写Firegesutres脚本，代码如下。 var url = gBrowser.currentURI.spec; gBrowser.removeCurrentTab&#40;&#41;; gBrowser.loadOneTab&#40;url, null, null, null, false, false&#41;; 那个“gBrowser.currentURI.spec”变量已是新地址了，地址栏你也更新一下不会死吧？因为用&#8217;gBrowser.loadURI”来在当前标签重新打开也是无效的，只好取得这个地址，关闭当前标签，再在新标签打开。 后来试了一下Opera和IE，都是这样的，只有Chromium是就是显示新地址的，很好，所以这算是Firefox的一个bug吧，于是我就去bugzilla提交bug报告了，渣英文自重，有闲的帮去顶一下，投个票就行了，别去普及我国国情。]]></description>
			<content:encoded><![CDATA[<p>虽然这个是小问题，还是有点不爽的，必须解决一下。标题的意思是，如果Firefox收到301重定向（短链接就是这样做的），跟随并打开新网页，如果出现网络错误（最常的就是被重置啦），显示了错误页面，而地址栏还是旧地址，而不是重定向后的新地址。</p>
<p>具体情况是，在Twitter上有不少人在分享极不河蟹的链接，一般都是缩短过的。比如用google“温习”，用TinyURL缩短后<a href="http://tinyurl.com/39pqs8d">这个链接</a>，你会发现TinyURL被重置了，其实是google被重置，只是Firefox地址栏没有更新而已。问题就在这里，Firefox就显示一个错误页面，没有任何原始地址信息，想修改也不行。不知道原始地址是什么，加进代理列表里就有点麻烦，得手动去展开，或许这个地址改成https协议就能浏览了。<span id="more-2423"></span></p>
<p><strong>更新</strong>：囧死，原来在当前标签页打开就会更新的，中键或粘贴到新标签页打开就不会更新，如果链接里有“target=&#8221;_blank&#8221;”来打开新标签页也是会更新的，<a target="_blank" href="http://tinyurl.com/39pqs8d">测试一下</a>。</p>
<p>还是找个解决方法吧，还是写Firegesutres脚本，代码如下。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> gBrowser.<span style="color: #660066;">currentURI</span>.<span style="color: #660066;">spec</span><span style="color: #339933;">;</span>
gBrowser.<span style="color: #660066;">removeCurrentTab</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
gBrowser.<span style="color: #660066;">loadOneTab</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>那个“gBrowser.currentURI.spec”变量已是新地址了，地址栏你也更新一下不会死吧？因为用&#8217;gBrowser.loadURI”来在当前标签重新打开也是无效的，只好取得这个地址，关闭当前标签，再在新标签打开。</p>
<p>后来试了一下Opera和IE，都是这样的，只有Chromium是就是显示新地址的，很好，所以这算是Firefox的一个bug吧，于是我就去bugzilla提交<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=564085">bug报告</a>了，渣英文自重，有闲的帮去顶一下，投个票就行了，别去普及我国国情。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/firefox_301_redirect_location_bar_not_update/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Google快照算半个代理了</title>
		<link>http://qixinglu.com/archives/google_snapshot_amount_to_a_proxy?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google_snapshot_amount_to_a_proxy</link>
		<comments>http://qixinglu.com/archives/google_snapshot_amount_to_a_proxy#comments</comments>
		<pubDate>Sat, 01 May 2010 11:49:40 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[FireGestures]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Greasemonkey]]></category>
		<category><![CDATA[https]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2412</guid>
		<description><![CDATA[这篇文章没什么新东西，若干文章和代码更新提醒。 不知什么时候Google的快照链接改变掉了，以前的地址是 http://快照服务器IP/search?q=cache:网页地址&#34; 由于“search?q=cache:”是敏感词，因此用greasemonkey插个“&#038;”符号，改成&#8221;search?&#038;q=cache“即可解决。不过后发现这个方法失效了，懒得折腾把地址加入foxyproxy算了。 现在Google快照变成 http://webcache.googleusercontent.com/search?q=cache:网页地址&#34; 有了固定的“webcache.googleusercontent.com”域名，还支持https的！http依然撞，那么顺便去更新一下之前的脚本。 《去掉Google快照重定向》的Greasemonkey脚本，貌似现在没有重定向了，后来又有了，那么加个功能，改链接为https。顺手再加两个，把结果链接的重定向也去掉，或者追加到“网页快照”旁边，修改代码开头的常量来启用吧。 《快速浏览当前页面的Google快照》里的Firegeustres脚本也更新了，划手势切换当前页面到google快照。 《继续在Google快照中浏览网页》的Greasemonkey脚本，这脚本作用就是把快照页面里的链接改写成快照链接（真拗口），以使用快照来浏览网页。 快照地址也支持https，也能用快照来浏览网页，不过这样某些网站图片还是看不到啊，刚想起之前不是还写过《Google的图片代理》么，那个Greasemonkey脚本改写图片地址为Google的代理地址，也是https的，把匹配网址加一个“https://webcache.googleusercontent.com/search?*”就好了（代码也更新了）。 这样文字和图片都有Google代理了，也能持续浏览，都是https的，所以说Google快照能当半个代理用了。当然，有米人能用收费SSH或VPN是不用这么折腾的。 虽然天朝用户呼声很高，但Google依然不提供https搜索，现在有啦，功夫网去死吧！之前我也无意在API文档的某个地址能实现https搜索，也为这个地址写个优化布局Greasemonkey脚本，不过这地址用起来还是不太方便。 我想Google提供https搜索根本不是技术问题，或许提供https搜索让服务器运算量过大？起码也可以按地区提供啊，还是怕整站被墙。虽然如此，Google还是有很多资源挖来实现类似目的的。 操蛋的天朝网络啊，草泥马啊。]]></description>
			<content:encoded><![CDATA[<p>这篇文章没什么新东西，若干文章和代码更新提醒。</p>
<p>不知什么时候Google的快照链接改变掉了，以前的地址是</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://快照服务器IP/search?q=cache:网页地址&quot;</pre></div></div>

<p>由于“search?q=cache:”是敏感词，因此用greasemonkey插个“&#038;”符号，改成&#8221;search?&#038;q=cache“即可解决。不过后发现这个方法失效了，懒得折腾把地址加入foxyproxy算了。</p>
<p>现在Google快照变成</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">http://webcache.googleusercontent.com/search?q=cache:网页地址&quot;</pre></div></div>

<p>有了固定的“webcache.googleusercontent.com”域名，还支持https的！http依然撞，那么顺便去更新一下之前的脚本。<span id="more-2412"></span></p>
<ul>
<li><a href="http://qixinglu.com/archives/remove_google_cahche_redirect">《去掉Google快照重定向》</a>的<a href="http://userscripts.org/scripts/show/40821">Greasemonkey脚本</a>，<del datetime="2010-05-12T13:08:10+00:00">貌似现在没有重定向了</del>，后来又有了，那么加个功能，改链接为https。顺手再加两个，把结果链接的重定向也去掉，或者追加到“网页快照”旁边，修改代码开头的常量来启用吧。</li>
<li><a href="http://qixinglu.com/archives/quick_google_cache">《快速浏览当前页面的Google快照》</a>里的<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/firegestures/google_snapshot.js">Firegeustres脚本</a>也更新了，划手势切换当前页面到google快照。</li>
<li><a href="http://qixinglu.com/archives/continue_browsing_using_google_cache">《继续在Google快照中浏览网页》</a>的<a href="http://userscripts.org/scripts/show/40822">Greasemonkey脚本</a>，这脚本作用就是把快照页面里的链接改写成快照链接（真拗口），以使用快照来浏览网页。</li>
<li>快照地址也支持https，也能用快照来浏览网页，不过这样某些网站图片还是看不到啊，刚想起之前不是还写过<a href="http://qixinglu.com/archives/google_image_proxy">《Google的图片代理》</a>么，那个<a href="http://userscripts.org/scripts/show/68761">Greasemonkey脚本</a>改写图片地址为Google的代理地址，也是https的，把匹配网址加一个“https://webcache.googleusercontent.com/search?*”就好了（代码也更新了）。
</ul>
<p>这样文字和图片都有Google代理了，也能持续浏览，都是https的，所以说Google快照能当半个代理用了。当然，有米人能用收费SSH或VPN是不用这么折腾的。</p>
<p>虽然天朝用户呼声很高，<del datetime="2010-05-22T01:30:39+00:00">但Google依然不提供https搜索</del>，现在有啦，功夫网去死吧！之前我也无意在API文档的<a href="https://www.google.com/uds/samples/apidocs/helloworld.html">某个地址</a>能实现https搜索，也为这个地址写个优化布局<a href="http://userscripts.org/scripts/show/72494">Greasemonkey脚本</a>，不过这地址用起来还是不太方便。</p>
<p>我想Google提供https搜索根本不是技术问题，或许提供https搜索让服务器运算量过大？起码也可以按地区提供啊，还是怕整站被墙。虽然如此，Google还是有很多资源挖来实现类似目的的。</p>
<p>操蛋的天朝网络啊，草泥马啊。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/google_snapshot_amount_to_a_proxy/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Google站内搜索的鼠标手势</title>
		<link>http://qixinglu.com/archives/google_site_search_firegestures_script?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google_site_search_firegestures_script</link>
		<comments>http://qixinglu.com/archives/google_site_search_firegestures_script#comments</comments>
		<pubDate>Mon, 19 Apr 2010 23:53:23 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[FireGestures]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2360</guid>
		<description><![CDATA[不好意思，这篇又是与Firefox有关了，近来灵感如尿崩没办法。 站内搜索Google工具栏是有这个功能的，可是我不喜欢安装，于是用Firegestures实现。 这个手势的作用是选择一段关键词，划手势，即用Google搜索”选中关键词 site:当前页面的域名”，如果没有选中，则弹出输出框输入搜索关键词。脚本代码在这里。 把下面一行改改就自定义更丰富的搜索参数了，如“inurl”、”intitle“等。 var searchtext = text + &#34; site:&#34; + window.content.location.hostname; 顺便提示一下，自定义过的脚本都写过好多了，不过我确实没记住那么多手势，那是因为使用了弹出菜单合并手势。]]></description>
			<content:encoded><![CDATA[<p>不好意思，这篇又是与Firefox有关了，近来灵感如尿崩没办法。</p>
<p>站内搜索Google工具栏是有这个功能的，可是我不喜欢安装，于是用Firegestures实现。</p>
<p>这个手势的作用是选择一段关键词，划手势，即用Google搜索”选中关键词 site:当前页面的域名”，如果没有选中，则弹出输出框输入搜索关键词。脚本代码在<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/firegestures/google_site_search.js">这里</a>。<span id="more-2360"></span></p>
<p>把下面一行改改就自定义更丰富的搜索参数了，如“inurl”、”intitle“等。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> searchtext <span style="color: #339933;">=</span> text <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; site:&quot;</span> <span style="color: #339933;">+</span> window.<span style="color: #660066;">content</span>.<span style="color: #660066;">location</span>.<span style="color: #660066;">hostname</span><span style="color: #339933;">;</span></pre></div></div>

<p>顺便提示一下，自定义过的脚本都写过好多了，不过我确实没记住那么多手势，那是因为使用了<a href="http://qixinglu.com/archives/create_firegestures_popup_menu">弹出菜单</a>合并手势。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/google_site_search_firegestures_script/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>两个调用Google翻译的鼠标手势</title>
		<link>http://qixinglu.com/archives/two_google_translate_firegestures_scripts?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=two_google_translate_firegestures_scripts</link>
		<comments>http://qixinglu.com/archives/two_google_translate_firegestures_scripts#comments</comments>
		<pubDate>Sun, 18 Apr 2010 14:40:45 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[FireGestures]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2343</guid>
		<description><![CDATA[这篇还是和Google翻译有关，最近这个应用需求量大了，再折腾两个Firegesutes脚本 翻译页面 这个很简单，没什么好说，跟之前的快照一样，划一下翻译当前页，再划一下切换回来，脚本代码在这里。 选择段落翻译 话说上篇文章给Echofon添加了翻译功能后，顺手把关键代码改成Firegesutres脚本，选择一段文字，划手势测试一下，发现居然有用，这些可爽死我了，脚本代码在这里。 原本也是用alert弹出个消息框来显示结果，但我对这种抢焦点的消息框表示不满，体验很不好，刚好看到谷奥的《Google Toolbar 加入鼠标取词翻译功能》，那种显示效果真好，想拿来使用。 于是新建一个配置文件夹，装上Google工具栏并开启Firebug窃取css，发现居然这不是网页里面的一个div，而是Firefox的一个面板（panel），于是我去看它的代码了，干！混淆过的，以为这样就能阻挡得我嘛？摸索半小时后，看出门路了，知道了它的实现方法后，马上Hacking Firegestures，添加了这种面板，专门用于显示信息，就几行代码而已，这里是补丁，并重新打包了，下载地址。 把脚本代码的第一行换成 USE_ALERT = false; 就可以使用这种面板来显示结果了。显示位置是在鼠标手势结束出的右边，偶然会漂移，你可以看这个开发文档页面来修改下面那行代码 p.openPopup&#40;event.target, &#34;end_before&#34;, 0, 0, false, false&#41;; 既然Firegestures脚本代码里也支持用用XMLHttpRequest来玩异步传输，Firefox的面板也不仅仅能显示文字，看来以后也有得玩了。]]></description>
			<content:encoded><![CDATA[<p>这篇还是和Google翻译有关，最近这个应用需求量大了，再折腾两个Firegesutes脚本</p>
<h3>翻译页面</h3>
<p>这个很简单，没什么好说，跟之前的快照一样，划一下翻译当前页，再划一下切换回来，脚本代码在<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/firegestures/google_translate_page.js">这里</a>。</p>
<h3>选择段落翻译</h3>
<p>话说上篇文章给Echofon添加了翻译功能后，顺手把关键代码改成Firegesutres脚本，选择一段文字，划手势测试一下，发现居然有用，这些可爽死我了，脚本代码在<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/firegestures/google_translate.js">这里</a>。<span id="more-2343"></span></p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Ftwo_google_translate_firegestures_scripts.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<p>原本也是用alert弹出个消息框来显示结果，但我对这种抢焦点的消息框表示不满，体验很不好，刚好看到谷奥的<a href="http://www.google.org.cn/posts/more-love-for-our-multilingual-toolbar-users.html">《Google Toolbar 加入鼠标取词翻译功能》</a>，那种显示效果真好，想拿来使用。</p>
<p>于是新建一个配置文件夹，装上Google工具栏并开启Firebug窃取css，发现居然这不是网页里面的一个div，而是Firefox的一个面板（panel），于是我去看它的代码了，干！混淆过的，以为这样就能阻挡得我嘛？摸索半小时后，看出门路了，知道了它的实现方法后，马上Hacking Firegestures，添加了这种面板，专门用于显示信息，就几行代码而已，<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/patch/firegestures_infoPanel.patch">这里是补丁</a>，并重新打包了，<a href="http://code.google.com/p/muzuiget-toolbox/downloads/detail?name=firegestures-1.5.7-fx-mod.xpi&#038;can=2&#038;q=">下载地址</a>。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Ftwo_google_translate_firegestures_scripts_1.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<p>把脚本代码的第一行换成</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">USE_ALERT <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre></div></div>

<p>就可以使用这种面板来显示结果了。显示位置是在鼠标手势结束出的右边，偶然会漂移，你可以看<a href="https://developer.mozilla.org/en/XUL/PopupGuide/Positioning">这个开发文档页面</a>来修改下面那行代码</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">p.<span style="color: #660066;">openPopup</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">target</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;end_before&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>既然Firegestures脚本代码里也支持用用XMLHttpRequest来玩异步传输，Firefox的面板也不仅仅能显示文字，看来以后也有得玩了。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/two_google_translate_firegestures_scripts/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>给Echofon添加翻译功能</title>
		<link>http://qixinglu.com/archives/echofon_add_translate_function?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=echofon_add_translate_function</link>
		<comments>http://qixinglu.com/archives/echofon_add_translate_function#comments</comments>
		<pubDate>Wed, 14 Apr 2010 08:32:44 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Echofon]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Twitterfox]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2325</guid>
		<description><![CDATA[最近发觉多懂一门外语真的很重要，如果不懂的话就只能靠翻译工具了，所以Hack了一下Echofon，添加了翻译功能，使用的是Google翻译工具。 添加的功能 给信息框的右键菜单，偷懒点就让Google自定检测语言，分别翻译到简体中文、繁体中文、英文、日文。 选择一条推，右键选择目标语言，然后弹出了一个消息框显示结果，在信息框左边的一个浮动面板显示结果，同时复制结果到剪贴板。怎么用，你懂的。 输入一段文字后，点击google的图标，选择对应语言翻译。对于翻译结果还是需要要手动修复一下的（因为Google把id或rt关键词也翻译了） 下载重新打包扩展或补丁 我重新打包了，懒人们不想手动修改就直接用吧，这里下载，安装前请卸载原来的Echofon（信息数据库会被保留的），修改如下 基于AMO下载的官方的Echonfon 1.9.6.4修改。 把名字改回“Twitterfox”，这样状态栏图标靠右边。 删除不必要的语言，只保留简繁中文和英文。 把XP样式修改成Twitterfox传统样式。 添加上述的翻译功能。 添加获取回复推功能。 对于使用了其它修改版的同学，比如可能吧的修改版，如果想手动添加进这个功能，这里是diff生成的patch，自己来或者通知修改者来添加进去吧。这个patch是就是我上述打包版本所做修改的补丁。另外加进了四个图像（google和twitter图标各两个），这里下载，复制到“Echofon.jar/content/images”文件夹即可。 补充 本来想直接把译文追加多原推后面的，因为用alert弹出消息框后，点击“OK”关闭时，Echofon的信息框也自动关闭，很不爽，而明明可以用 tweet.getAttribute&#40;&#34;text&#34;&#41; 来获取推的文本，而使用 tweet.setAttribute&#40;&#34;text&#34;, result_text&#41;; 更新却没有效果，折腾许久不成功，只能退回用alert了，哪位路过的神仙能指点一二。 更新1：要Hack就Hack得彻底，不用alert了，改用浮动面板显示，不过Linux用户在Firefox 3.6下还是无法自动消失，而且不能用鼠标滚动（但还拖滚动条还是可以的），这样还是比用alert好多了。这个bug与Echofon有关，希望它后期能完整点解决这个问题。 更新2：把输入的文本框也加入了翻译功能，完满了，折腾暂告一段落，以后有Echofon新版的话，而功能值得更新的话，再修改好了。 更新3：在右键菜单添加“获取回复推”功能，不过被回复的用户的推是保护的话就获取不到。]]></description>
			<content:encoded><![CDATA[<p>最近发觉多懂一门外语真的很重要，如果不懂的话就只能靠翻译工具了，所以Hack了一下Echofon，添加了翻译功能，使用的是<a href="http://translate.google.com/#">Google翻译工具</a>。</p>
<h3>添加的功能</h3>
<p>给信息框的右键菜单，偷懒点就让Google自定检测语言，分别翻译到简体中文、繁体中文、英文、日文。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fechofon_add_translate_function.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /><span id="more-2325"></span></p>
<p>选择一条推，右键选择目标语言，<del datetime="2010-04-16T10:03:04+00:00">然后弹出了一个消息框显示结果</del>，在信息框左边的一个浮动面板显示结果，同时复制结果到剪贴板。怎么用，你懂的。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fechofon_add_translate_function_1.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<p>输入一段文字后，点击google的图标，选择对应语言翻译。对于翻译结果还是需要要手动修复一下的（因为Google把id或rt关键词也翻译了）</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fechofon_add_translate_function_2.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<h3>下载重新打包扩展或补丁</h3>
<p>我重新打包了，懒人们不想手动修改就直接用吧，<a href="http://code.google.com/p/muzuiget-toolbox/downloads/detail?name=twitterfox-1.9.6.2-fx-mod.xpi&#038;can=2&#038;q=">这里下载</a>，安装前请卸载原来的Echofon（信息数据库会被保留的），修改如下</p>
<ul>
<li>基于AMO下载的官方的Echonfon 1.9.6.4修改。</li>
<li>把名字改回“Twitterfox”，这样<a href="http://qixinglu.com/archives/fixup_firefox_status_bar_icon_order">状态栏图标靠右边</a>。</li>
<li>删除不必要的语言，只保留简繁中文和英文。</li>
<li>把XP样式修改成<a href="http://qixinglu.com/archives/echofon_twitterfox_classic_theme">Twitterfox传统样式</a>。</li>
<li>添加上述的翻译功能。</li>
<li>添加获取回复推功能。</li>
</ul>
<p>对于使用了其它修改版的同学，比如<a href="https://www.kenengba.com/post/2752.html">可能吧的修改版</a>，如果想手动添加进这个功能，<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/patch/echofon_translate.patch">这里</a>是diff生成的patch，自己来或者通知修改者来添加进去吧。这个patch是就是我上述打包版本所做修改的补丁。另外加进了四个图像（google和twitter图标各两个），<a href="http://qixinglu.com/temp/twitterfox_images.7z">这里</a>下载，复制到“Echofon.jar/content/images”文件夹即可。</p>
<h3>补充</h3>
<p>本来想直接把译文追加多原推后面的，因为用alert弹出消息框后，点击“OK”关闭时，Echofon的信息框也自动关闭，很不爽，而明明可以用</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">tweet.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>来获取推的文本，而使用</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">tweet.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #339933;">,</span> result_text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>更新却没有效果，折腾许久不成功，只能退回用alert了，哪位路过的神仙能指点一二。</p>
<p><strong>更新1</strong>：要Hack就Hack得彻底，不用alert了，改用浮动面板显示，不过Linux用户在Firefox 3.6下还是无法自动消失，而且不能用鼠标滚动（但还拖滚动条还是可以的），这样还是比用alert好多了。这个bug与Echofon有关，希望它后期能完整点解决这个问题。</p>
<p><strong>更新2</strong>：把输入的文本框也加入了翻译功能，完满了，折腾暂告一段落，以后有Echofon新版的话，而功能值得更新的话，再修改好了。</p>
<p><strong>更新3</strong>：在右键菜单添加“获取回复推”功能，不过被回复的用户的推是保护的话就获取不到。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/echofon_add_translate_function/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>使用Flashgot调用外部播放器看网站视频</title>
		<link>http://qixinglu.com/archives/flashgot_call_desktop_player?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flashgot_call_desktop_player</link>
		<comments>http://qixinglu.com/archives/flashgot_call_desktop_player#comments</comments>
		<pubDate>Sun, 11 Apr 2010 11:50:48 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Flashgot]]></category>
		<category><![CDATA[mplayer]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2300</guid>
		<description><![CDATA[标题的网站视频就是指优酷、56、土豆之类的网站视频，为什么要调用外部播放器来播放呢，因为一些怀旧经典视频，多是从VCD转录的，这个古老的产物对不同配音是用左右声道的解决的，也就是左声道国语，右声道粤语，对于MTV，一个声道是纯配乐，比如下面截图的MTV，而网站的Flash播放器没有声道选择功能，这就不爽了。哦，你说用系统的声音平衡干掉一个，或者直接拔掉一条音箱线，好主意，不过问题是，如果是戴耳机的呢，一边有声一边无声听起来很不舒服的。 另一个方法就是把嗅出视频地址，下载回来用桌面播放器来播放，而且Linux的Flash插件效率也不太好，容易造成浏览器崩溃，而且那个网站还在Flash内嵌广告，adp不起作用，桌面播放器也能提供更多的播放选项，好处多多。 不过先下载再打开播放器这个过程还是比较麻烦的，影响操作流畅感，作为一名忠实的Firefox和Linux的Fans，要把这个操作自动化。 嗅探Flash的视频地址扩展有好几个，我用的是flashgot，当播放Flash视频时，会在状态栏显示嗅探到的视频地址，点击左键就下载，点右键还可以看视频的大小，非常好用。flashgot原本的功能就是批量下载，管理外部下载程序，不过，不一定是下载程序的，播放器或者其它程序都可以了，把下载地址作为参数传过去就行了。 调用外部播放器 在flashgot的选项窗口里，添加一个下载程序，名称为“smplayer”，然后选择smplayer的执行文件，保存，也可以添加多几个，mplayer或者vlc，看你喜欢。 以后在菜单里的“flashgot选项”里切换使用的下载器，对于一般文件，使用DTA，对于Flash视频，切换到“smplayer”，在点一下状态栏的图标就可以用smplayer打开当前页面的视频了，然后调整声道，非常简单，同时把页面关掉，免的和Firefox抢流量。 下载缓冲长度 还有个问题，这样做就是相当于在线播放了，但无法回退到播放过之前的内容，也就是进度条无法拖回去，一个解决方法是，适当缓存调大一点，比如弄成10m。 对于mplayer，调用参数是 -cache 10240 [URL] 对于smplayer，要在smplayer设置里的“高级”，“mplayer选项”的第一栏里填入“-cache 10240”。 mplayer控制左右声道 用上面的方法打开smplayer调声道还是有不足之处，就是切换声道是要重新缓冲，或许它也有控制的参数，但我没找到，直接用mplayer就可以，使用声音滤镜，它的参数如下 mplayer -af channels=nch&#91;:nr:from1:to1:from2:to2:from3:to3:...&#93; file nch是指输出声道数量，nr是指声道route的数量，这个route看起来好像很专业的术语，我看了一下说明，这个数值是和后边的“from:to”对数量一样的，一对“from:to”就是一个route了，或者叫“映射”比较好理解点吧。 对于把左声道混缩到两声道，建立下载器&#8221;mplayer (left channel)”，它的运行参数如下 -af channels=2:2:0:1:0:0 [URL] 简单解释一下， “2:2”表示设定了2个输出声道和2个route 后面第一个“0:1”，表示把输入的第0声道（这里即是原始的左声道啦），复制到输出的第1声道（这里即是实际输出的右声道了）里。 同样，“0:0”表示把输入的第0声道，输出的第0声道，换句话说，什么也没有做，保留原来的左声道。 这样因为右声道没有指定输出，所以就给屏蔽掉了，左声道混缩到两声道了。所以， 只输出右声道的话，参数是 -af channels=2:2:1:0:1:1 [URL] 交换左右声道，则是 -af channels=2:2:1:0:0:1 &#8230; <a href="http://qixinglu.com/archives/flashgot_call_desktop_player">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>标题的网站视频就是指优酷、56、土豆之类的网站视频，为什么要调用外部播放器来播放呢，因为一些怀旧经典视频，多是从VCD转录的，这个古老的产物对不同配音是用左右声道的解决的，也就是左声道国语，右声道粤语，对于MTV，一个声道是纯配乐，比如<a href="http://v.youku.com/v_show/id_XMTg2NzcxNzI=.html">下面截图的MTV</a>，而网站的Flash播放器没有声道选择功能，这就不爽了。哦，你说用系统的声音平衡干掉一个，或者直接拔掉一条音箱线，好主意，不过问题是，如果是戴耳机的呢，一边有声一边无声听起来很不舒服的。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fflashgot_call_desktop_player.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /><span id="more-2300"></span></p>
<p>另一个方法就是把嗅出视频地址，下载回来用桌面播放器来播放，而且Linux的Flash插件效率也不太好，容易造成浏览器崩溃，而且那个网站还在Flash内嵌广告，adp不起作用，桌面播放器也能提供更多的播放选项，好处多多。</p>
<p>不过先下载再打开播放器这个过程还是比较麻烦的，影响操作流畅感，作为一名忠实的Firefox和Linux的Fans，要把这个操作自动化。</p>
<p>嗅探Flash的视频地址扩展有好几个，我用的是flashgot，当播放Flash视频时，会在状态栏显示嗅探到的视频地址，点击左键就下载，点右键还可以看视频的大小，非常好用。flashgot原本的功能就是批量下载，管理外部下载程序，不过，不一定是下载程序的，播放器或者其它程序都可以了，把下载地址作为参数传过去就行了。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fflashgot_call_desktop_player_1.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<h3>调用外部播放器</h3>
<p>在flashgot的选项窗口里，添加一个下载程序，名称为“smplayer”，然后选择smplayer的执行文件，保存，也可以添加多几个，mplayer或者vlc，看你喜欢。</p>
<p>以后在菜单里的“flashgot选项”里切换使用的下载器，对于一般文件，使用DTA，对于Flash视频，切换到“smplayer”，在点一下状态栏的图标就可以用smplayer打开当前页面的视频了，然后调整声道，非常简单，同时把页面关掉，免的和Firefox抢流量。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fflashgot_call_desktop_player_2.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<h3>下载缓冲长度</h3>
<p>还有个问题，这样做就是相当于在线播放了，但无法回退到播放过之前的内容，也就是进度条无法拖回去，一个解决方法是，适当缓存调大一点，比如弄成10m。</p>
<ul>
<li>对于mplayer，调用参数是</li>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-cache 10240 [URL]</pre></div></div>

<li>对于smplayer，要在smplayer设置里的“高级”，“mplayer选项”的第一栏里填入“-cache 10240”。</li>
</ul>
<h3>mplayer控制左右声道</h3>
<p>用上面的方法打开smplayer调声道还是有不足之处，就是切换声道是要重新缓冲，或许它也有控制的参数，但我没找到，直接用mplayer就可以，使用声音滤镜，它的参数如下</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mplayer</span> <span style="color: #660033;">-af</span> <span style="color: #007800;">channels</span>=nch<span style="color: #7a0874; font-weight: bold;">&#91;</span>:nr:from1:to1:from2:to2:from3:to3:...<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">file</span></pre></div></div>

<p>nch是指输出声道数量，nr是指声道route的数量，这个route看起来好像很专业的术语，我看了一下说明，这个数值是和后边的“from:to”对数量一样的，一对“from:to”就是一个route了，或者叫“映射”比较好理解点吧。</p>
<p>对于把左声道混缩到两声道，建立下载器&#8221;mplayer (left channel)”，它的运行参数如下</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-af channels=2:2:0:1:0:0 [URL]</pre></div></div>

<p>简单解释一下，</p>
<ol>
<li>“2:2”表示设定了2个输出声道和2个route</li>
<li>后面第一个“0:1”，表示把输入的第0声道（这里即是原始的左声道啦），复制到输出的第1声道（这里即是实际输出的右声道了）里。</li>
<li>同样，“0:0”表示把输入的第0声道，输出的第0声道，换句话说，什么也没有做，保留原来的左声道。</li>
</ol>
<p>这样因为右声道没有指定输出，所以就给屏蔽掉了，左声道混缩到两声道了。所以，</p>
<ul>
<li>只输出右声道的话，参数是</li>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-af channels=2:2:1:0:1:1 [URL]</pre></div></div>

<li>交换左右声道，则是</li>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-af channels=2:2:1:0:0:1 [URL]</pre></div></div>

</ul>
<p>不明白的话，直接复制参数好了。</p>
<h3>观看时同时下载</h3>
<p>还有不爽的，继续折腾，smplayer修改过视频或者音频设置后，又在重新缓冲的，太浪费带宽了，超过缓冲大小又不能回退了，最好是边播放边下载到本地保存，看了mplayer的manpage后，有个“-dumpstream”参数，可以把视频流保存下载，可是使用这个参数后就不再显示画面了，怨念啊。</p>
<p>所以换个思路，先用其它程序来下载，下载到一定大小后，再用调用mplayer播放，因为mplayer未下载完成也可以播放的，这样就是先边下载边播放功能了，也不用重新缓冲，随时回退。</p>
<p>于是我写了个脚本，下载地址在<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/shell_scripts/downNplay.sh">这里</a>，Linux专用的，Windows用户自己改写吧，复制到你喜欢的目录，我是“/usr/local/bin”，新建一个Flashgot下载器，名为&#8221;downNplay”，执行文件指定为这个脚本。</p>
<p>脚本前有三个选项可选</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">CACHE_DIR</span>=~<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">DELAY</span>=<span style="color: #000000;">3</span>
<span style="color: #007800;">PLAYER</span>=smplayer</pre></div></div>

<p>作用分别是</p>
<ol>
<li>下载目录，默认是家目录，一定要是已存在的目录。</li>
<li>延迟3秒打开播放器</li>
<li>使用smplayer播放器</li>
</ol>
<p>这里的延迟要说一下，就是wget后台运行，休眠3秒后，再调用播放器开始播放，延迟值3秒如果网速不好的话，可能不够快，可调大点，或者smplayer里先停止再开始重新播放。不过对于我来说，优酷速度很理想，3秒已经足够了。</p>
<p>关闭播放器后，wget同时停止下载，由于优酷和56都不支持断点续传，未下载完成的话，文件名会被加上“.tmp”，下次下载发现同名的话会被删除。</p>
<h3>下载时同时显示下载进度</h3>
<p>点击状态栏flashgot媒体嗅探按钮后，延迟3秒打开播放器，有时我自己也以后没打开，多按了一次，如果加个显示下载进度功能就好了，观看时也方便快进。想了一下，也不算太难，再建个“downNplay (terminal)”，执行程序选择“gnome-terminal“，参数填</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">-x /usr/local/bin/downNplay.sh [URL]</pre></div></div>

<p>通过gnome-terminal来调用脚本就能看到wget的下载进度了，关闭播放器时，这个终端也会自动关闭。</p>
<p><img src="https://images2-focus-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fdl.dropbox.com%2Fu%2F2992664%2Fblog%2Fflashgot_call_desktop_player_3.png&container=focus&gadget=a&no_expand=1&resize_h=0&rewriteMime=image%2F*" alt="" /></p>
<h3>补充</h3>
<p>脚本延迟3秒打开播放器，本来的想法，下载够指定大小再播放（比如512k），因为网速不太好的话，用延迟方法不太好，可惜wget不支持下载指定大小后停止下载功能（那个“-Q”参数对单个文件无效的），后来在Twitter上抱怨了一下，骨头兄说可以用“curl -r”，可是我已经折腾完了，下次再改好了。</p>
<p>本来flashgot也支持把当前网页的标题也传到脚本的，用作为保存文件名，但是在脚本中乱码了，原因未明。</p>
<p>第一张图是《旧梦不须记》，MTV剧情以今天的眼光看起来真是土得掉渣，但是这首歌真是非常好听，而且词曲都是<a href="http://zh.wikipedia.org/wiki/%E9%BB%84%E9%9C%91">黄霑</a>，霑叔的词写得真好啊，有文采有内涵，当今的所谓流行曲，快餐式歌词，内容无病呻吟。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/flashgot_call_desktop_player/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>调用Tineye的鼠标手势</title>
		<link>http://qixinglu.com/archives/firegestures_tineye_image_search?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=firegestures_tineye_image_search</link>
		<comments>http://qixinglu.com/archives/firegestures_tineye_image_search#comments</comments>
		<pubDate>Fri, 05 Mar 2010 13:29:08 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[FireGuestures]]></category>
		<category><![CDATA[Tineye]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2258</guid>
		<description><![CDATA[Tineye是一个反向图片搜索引擎，是个很有趣的网站，上传一张图片或者提交图片的地址，它替搜索出包含你提交图片的网页，连和大叔用过都说好。 而使用这个搜索引擎，需要右键复制图片地址，新建标签页，打开Tineye的网站，粘贴地址，点击“搜索按钮”，等待结果，这几个步骤用多了比较麻烦，所以找个捷径。 Tineye官方是提供浏览器扩展的，使用右键菜单打开选择图片，也有Bookmarklet书签，不过是提交网页，Tineye分析网页上的图片给你选择。 而我不想多装一个扩展，而用Bookmarklet不在Noscipt白名单上的话就失效，所以也写一个Firegestures脚本。 初看Tineye的搜索地址，是“http://www.tineye.com/search/图片的sha1值”，看来要构造这个地址会有点麻烦，需要事先计算出图片的sha1值，而它的API是收费的，不过我后来看了扩展和Bookmarklet的代码，发现也可以用“http://www.tineye.com/search/?url=图片地址”来调用，这样代码就容易写了。 代码地址点击这里，默认行为是选择鼠标手势的起点，如果手势起点不是图片，则使用手势终点，如果也不是图片，则使用当前网址，搜索结果页在新标签页打开。]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tineye.com">Tineye</a>是一个反向图片搜索引擎，是个很有趣的网站，上传一张图片或者提交图片的地址，它替搜索出包含你提交图片的网页，连<a href="http://www.hecaitou.net/?p=6842">和大叔用过都说好</a>。</p>
<p>而使用这个搜索引擎，需要右键复制图片地址，新建标签页，打开Tineye的网站，粘贴地址，点击“搜索按钮”，等待结果，这几个步骤用多了比较麻烦，所以找个捷径。</p>
<p>Tineye官方是提供<a href="http://www.tineye.com/plugin">浏览器扩展</a>的，使用右键菜单打开选择图片，也有<a href="http://www.tineye.com/bookmarklet">Bookmarklet书签</a>，不过是提交网页，Tineye分析网页上的图片给你选择。<span id="more-2258"></span></p>
<p>而我不想多装一个扩展，而用Bookmarklet不在Noscipt白名单上的话就失效，所以也写一个Firegestures脚本。</p>
<p>初看Tineye的搜索地址，是“http://www.tineye.com/search/图片的sha1值”，看来要构造这个地址会有点麻烦，需要事先计算出图片的sha1值，而它的API是收费的，不过我后来看了扩展和Bookmarklet的代码，发现也可以用“http://www.tineye.com/search/?url=图片地址”来调用，这样代码就容易写了。</p>
<p>代码地址<a href="http://code.google.com/p/muzuiget-toolbox/source/browse/trunk/firegestures/tineye_image_search.js">点击这里</a>，默认行为是选择鼠标手势的起点，如果手势起点不是图片，则使用手势终点，如果也不是图片，则使用当前网址，搜索结果页在新标签页打开。</p>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/firegestures_tineye_image_search/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>固定Firefox状态栏图标顺序</title>
		<link>http://qixinglu.com/archives/fixup_firefox_status_bar_icon_order?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=fixup_firefox_status_bar_icon_order</link>
		<comments>http://qixinglu.com/archives/fixup_firefox_status_bar_icon_order#comments</comments>
		<pubDate>Mon, 01 Mar 2010 09:29:39 +0000</pubDate>
		<dc:creator>muzuiget</dc:creator>
				<category><![CDATA[浏览器]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://qixinglu.com/?p=2244</guid>
		<description><![CDATA[我之前写过《手动修改Firefox状态栏图标顺序》，通过修改“extensions.ini”文件，把Echonfon的图标弄回靠右的位置，但那个方法有一个问题，就是当你添加、删除、更新、启用和禁用过扩展后，图标顺序就打回原形了，得再修改一次，很烦，于是我就研究一下怎么永久固定它。 排序原因 经我研究，“extensions.ini”文件里的顺序就是按照扩展的名称的字母来排序的，扩展面板里也是这样。对于状态栏图标，从左边开始排序， 即名称的字母越靠前，图标就越靠左。但也有特例的，我装的“CS Lite”这个扩展就在最左边，可能它的代码特别指定了位置。 所以这就能解释为什么之前“Twitterfox”会在右边第二位置，在我安装的扩展中，名称排在它后面的只有“Yet Another Smooth Scrolling”，“而改成了“Echofon”后，就排在其它扩展前面了。所以把名称改回“Twitterfox”就行了，&#8221;Echofon”这名字实在太失败了。 修改方法 用文本编辑器打开“你的Firefox配置文件夹/extensions/twitternotifier@naan.net/install.rdf”这个文件，开头如下代码 &#60;em:id&#62;twitternotifier@naan.net&#60;/em:id&#62; &#60;em:name&#62;Echofon&#60;/em:name&#62; &#60;em:version&#62;1.9.5.1&#60;/em:version&#62; 把中间那行“Echofon”改回“Twitterfox”就行了。接下来就是让Firefox重新读取这个扩展信息，有两个方法 反复启用/禁用Echofon，重启Firefox若干次，直到名称和状态栏图标位置改变。我也找不到规律，总之反复重启几次就行了。 或者干脆点先卸载再重新安装，在“twitternotifier@naan.net”目录里，全选，把所有文件打包为zip，再改扩展名为”xpi“，然后在扩展面板里卸载掉Echofon，重启Firefox，再拉进这个xpi文件来安装。]]></description>
			<content:encoded><![CDATA[<p>我之前写过<a href="http://qixinglu.com/archives/manually_change_firefox_status_bar_icon_order">《手动修改Firefox状态栏图标顺序》</a>，通过修改“extensions.ini”文件，把Echonfon的图标弄回靠右的位置，但那个方法有一个问题，就是当你添加、删除、更新、启用和禁用过扩展后，图标顺序就打回原形了，得再修改一次，很烦，于是我就研究一下怎么永久固定它。</p>
<h3>排序原因</h3>
<p>经我研究，“extensions.ini”文件里的顺序就是按照扩展的名称的字母来排序的，扩展面板里也是这样。对于状态栏图标，从左边开始排序， 即名称的字母越靠前，图标就越靠左。但也有特例的，我装的“CS Lite”这个扩展就在最左边，可能它的代码特别指定了位置。<span id="more-2244"></span></p>
<p>所以这就能解释为什么之前“Twitterfox”会在右边第二位置，在我安装的扩展中，名称排在它后面的只有“Yet Another Smooth Scrolling”，“而改成了“Echofon”后，就排在其它扩展前面了。所以把名称改回“Twitterfox”就行了，&#8221;Echofon”这名字实在太失败了。</p>
<h3>修改方法</h3>
<p>用文本编辑器打开“你的Firefox配置文件夹/extensions/twitternotifier@naan.net/install.rdf”这个文件，开头如下代码</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;em:id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>twitternotifier@naan.net<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/em:id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;em:name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Echofon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/em:name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;em:version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.9.5.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/em:version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>把中间那行“Echofon”改回“Twitterfox”就行了。接下来就是让Firefox重新读取这个扩展信息，有两个方法</p>
<ul>
<li>反复启用/禁用Echofon，重启Firefox若干次，直到名称和状态栏图标位置改变。我也找不到规律，总之反复重启几次就行了。</li>
<li>或者干脆点先卸载再重新安装，在“twitternotifier@naan.net”目录里，全选，把所有文件打包为zip，再改扩展名为”xpi“，然后在扩展面板里卸载掉Echofon，重启Firefox，再拉进这个xpi文件来安装。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://qixinglu.com/archives/fixup_firefox_status_bar_icon_order/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
