Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One way to do this is to:</p> <ol> <li>Find the offending <code>&lt;link&gt;</code> using the constant part of the text in the <code>href</code>.</li> <li>Record that link's <code>href</code>.</li> <li>Delete that link.</li> <li>Use <code>GM_xmlhttpRequest()</code> to fetch the file again (hopefully it's cached).</li> <li>Use regex to fix the fetched CSS.</li> <li>Use <code>GM_addStyle()</code> to add the fixed CSS.</li> </ol> <p>Here's <strong>a complete Greasemonkey script</strong> that illustrates the process:</p> <pre><code>// ==UserScript== // @name _Replace bad CSS link // @include http://www.fleaflicker.com/nfl/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant GM_addStyle // @grant GM_xmlhttpRequest // ==/UserScript== var badCSS = $("link[href*='global-cdn-']"); var badURL = badCSS.attr ("href"); badCSS.remove (); GM_xmlhttpRequest ( { method: "GET", url: badURL, onload: function (rsp){ var betterCSS = rsp.responseText.replace ( /max-width:990px/g, "max-width:500px" ); GM_addStyle (betterCSS); } } ); </code></pre> <p><br></p> <hr> <p>Notes:</p> <ol> <li>For faster/better performance, if the CSS does not change often, hand edit it and save it in the same folder that you install your script from. Then use <code>GM getResourceText()</code> to get the CSS, instead of <code>GM_xmlhttpRequest()</code>.</li> <li>If page "flicker is an annoyance, due to start-up delays, that is a whole other problem, that can <em>probably</em> be solved with <code>@run-at document-start</code> and mutation observers.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload