Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Reveal password with javascript

1
2
3
Paste into url bar:

javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no saved passwords in forms on this page.");})();
https://snipt.net/embed/f5fd9839d056cd80066d86ff6f624a61/
https://snipt.net/raw/f5fd9839d056cd80066d86ff6f624a61/
f5fd9839d056cd80066d86ff6f624a61
js
JavaScript
4
2016-12-09T16:18:18
True
False
False
/api/public/snipt/60188/
reveal-password-with-javascript
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">Paste</span> <span class="nx">into</span> <span class="nx">url</span> <span class="nx">bar</span><span class="o">:</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nx">javascript</span><span class="o">:</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="kd">var</span> <span class="nx">s</span><span class="p">,</span><span class="nx">F</span><span class="p">,</span><span class="nx">j</span><span class="p">,</span><span class="nx">f</span><span class="p">,</span><span class="nx">i</span><span class="p">;</span> <span class="nx">s</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span> <span class="nx">F</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">forms</span><span class="p">;</span> <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">F</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="o">++</span><span class="nx">j</span><span class="p">)</span> <span class="p">{</span> <span class="nx">f</span> <span class="o">=</span> <span class="nx">F</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span> <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">f</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="nx">f</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">type</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;password&quot;</span><span class="p">)</span> <span class="nx">s</span> <span class="o">+=</span> <span class="nx">f</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span><span class="p">;</span> <span class="p">}</span> <span class="p">}</span> <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="nx">alert</span><span class="p">(</span><span class="s2">&quot;Passwords in forms on this page:\n\n&quot;</span> <span class="o">+</span> <span class="nx">s</span><span class="p">);</span> <span class="k">else</span> <span class="nx">alert</span><span class="p">(</span><span class="s2">&quot;There are no saved passwords in forms on this page.&quot;</span><span class="p">);})();</span> </span></pre></div> </td></tr></table>
browser, hack, js, password
Copyrighted, illegal, or inappropriate content? Email [email protected].