Skip to content

Commit

Permalink
add instruction for chrome extension
Browse files Browse the repository at this point in the history
  • Loading branch information
metaphox committed May 18, 2016
1 parent 063e935 commit 94a3996
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions zhihuexpand.html
@@ -1,7 +1,8 @@
<strong>What it does: it clicks the shit out of 更多 button every 3 sec untill it disappears, and expand any collapsed answer along the way.</strong>
<strong>What it does: clicks the shit out of 更多 button every 3 sec untill it disappears, and expands any collapsed answer along the way.</strong>
<hr>
Installation:<br>
For Chrome and any other sane browser:<br>
<h3>Installation</h3>
<h4>As Bookmarklet</h4>
For Chrome (and any other sane browser) this could be 'installed' simply as a bookmarklet:<br>
1. Drag this link <a href="javascript:(function(){
function zhexpandall(){
var expandbtns = document.querySelectorAll('a.toggle-expand');
Expand All @@ -19,14 +20,23 @@
})()">zhexpand!</a> to your bookmark bar. feel free to rename it.<br>
2. Go into a <em>single</em> question page and click the bookmark. The page should start scroll itself down and the 更多 button is clicked. If the process gets aborted for some reason, just click the bookmark again.
<hr>
For Firefox:<br>
<h4>As Extension / Addon</h4>
For <b>Firefox</b> this has to be installed as an extension (due to script source restriction):<br>
1. Download <a href="https://github.com/metaphox/zhexpand/raw/master/zhexpand-0.2-fx.xpi">zhexpand-0.2-fx.xpi</a>.<br>
2. Install it. Yes I did sign it, mozilla forced my hand.<br>
3. You should see a blue '[ + ]' button in the top right corner, just below your userlame. (lame!) Try click it on a <em>single</em> question page.<br>
4. (I hate to say but this extension for Firefox actually has a better feature: you can click the '[ / ]' to make it stop.)<br>
2. Install it by dragging the .xpi file into firefox. Yes I did sign it, mozilla forced my hand.<br>
3. When browsing zhihu.com, you should see a blue '[ + ]' button in the top right corner, just below your userlame. (lame!) Try click it on a <em>single</em> question page.<br>
4. Click the '[ / ]' to stop the expansion process.<br>
<br>
It's BSD and WTFPL licenced.<br>
Optionally, <b>Chrome</b> users can also install it as an extension. Since I don't want to put it into Chrome webstore, this must be done the hard way:<br>
1. Download the zipped source code <a href="https://github.com/metaphox/zhexpand/archive/master.zip">master.zip</a>.<br>
2. Unpack the .zip file to, say, Downloads/zhexpand.<br>
3. In Chrome, go to <a href="chrome://extensions/">chrome://extensions/</a> or Option Button - More Tools - Extensions, click "Load unpacked extension...", then choose the directory where you just unpacked the .zip file, e.g. Downloads/zhexpand, click ok. The extension should appear in the list. There might be a warning complaining unknown stuff in the manifest file, but that's okay.<br>
4. Open a new tab and visit zhihu.com. You should see a blue '[ + ]' button in the top right corner, just below your username. Try click it on a <em>single</em> question page.<br>
4. Click the '[ / ]' to stop the expansion process.
<hr>
BSD and WTFPL licenced.<br>
<a href="http://www.wtfpl.net/"><img
src="http://www.wtfpl.net/wp-content/uploads/2012/12/logo-220x1601.png"
width="220" height="160" alt="WTFPL" /></a>

<hr>
<p>This tiny extension was made specifically to <a href="https://www.zhihu.com/people/magasa">Magasa</a>'s request. In other words, if he doesn't complain, this thing stays as it is.</p>

0 comments on commit 94a3996

Please sign in to comment.