snipt

Ctrl+h for KB shortcuts

JavaScript

Clear CSS cache in Firefox bookmarklet

javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})();
https://snipt.net/embed/6aeca59c5b12172f0ddadf09d40acd3c/
/raw/6aeca59c5b12172f0ddadf09d40acd3c/
6aeca59c5b12172f0ddadf09d40acd3c
js
JavaScript
1
2019-06-27T00:27:35
True
False
False
Aug 25, 2012 at 04:58 AM
/api/public/snipt/46283/
clear-css-cache-in-firefox-bookmarklet
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</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">javascript</span><span class="o">:</span><span class="k">void</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">i</span><span class="p">,</span><span class="nx">a</span><span class="p">,</span><span class="nx">s</span><span class="p">;</span><span class="nx">a</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;link&#39;</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">a</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">i</span><span class="o">++</span><span class="p">){</span><span class="nx">s</span><span class="o">=</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</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">rel</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;stylesheet&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">&amp;&amp;</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">)</span><span class="o">%</span><span class="mi">20</span><span class="p">{</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">h</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/(&amp;|%5C?)forceReload=d+/</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">);</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="o">=</span><span class="nx">h</span><span class="o">+</span><span class="p">(</span><span class="nx">h</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">?</span><span class="s1">&#39;&amp;&#39;</span><span class="o">:</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">+</span><span class="s1">&#39;forceReload=&#39;</span><span class="o">+</span><span class="p">(</span><span class="k">new</span><span class="o">%</span><span class="mi">20</span><span class="nb">Date</span><span class="p">().</span><span class="nx">valueOf</span><span class="p">())}}})();</span> </span></pre></div> </td></tr></table>
bookmarklet, cache, css