Note that there are some explanatory texts on larger screens.

plurals
  1. POGreasemonkey @require jQuery not working "Component not available"
    text
    copied!<p>I've seen <a href="https://stackoverflow.com/questions/859024/how-can-i-use-jquery-in-greasemonkey">the other question on here</a> about loading jQuery in a Greasemonkey. Having tried that method, with this require statement inside my <code>==UserScript==</code> tags:</p> <pre><code>// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js </code></pre> <p>I still get the following error message in Firefox's error console:</p> <pre><code>Error: Component is not available Source File: file:///Users/greg/Library/Application%20Support/ Firefox/Profiles/xo9xhovo.default/gm_scripts/myscript/jquerymin.js Line: 36 </code></pre> <p>This stops my greasemonkey code from running. I've made sure I included the <code>@require</code> for jQuery and saved my js file before installing it, as required files are only loaded on installation.</p> <p>Code:</p> <pre><code>// ==UserScript== // @name My Script // @namespace http://www.google.com // @description My test script // @include http://www.google.com // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // ==/UserScript== GM_log("Hello"); </code></pre> <p>I have Greasemonkey 0.8.20091209.4 installed on Firefox 3.5.7 on my Macbook Pro, Leopard (10.5.8). I've cleared my cache (except cookies) and have disabled all other plugins except Flashblock 1.5.11.2, Web Developer 1.1.8 and Adblock Plus 1.1.3.</p> <p>My <code>config.xml</code> with my Greasemonkey script installed:</p> <pre><code>&lt;UserScriptConfig&gt; &lt;Script filename="myscript.user.js" name="My Script" namespace="http://www.google.com" description="My test script" enabled="true" basedir="myscript"&gt; &lt;Include&gt;http://www.google.com&lt;/Include&gt; &lt;Require filename="jquerymin.js"/&gt; &lt;/Script&gt; </code></pre> <p></p> <p>I can see jquerymin.js sat in the <code>gm_scripts/myscript/</code> directory.</p> <p>Additionally, is it common for this error to occur in the console when installing a Greasemonkey script?</p> <pre><code>Error: not well-formed Source File: file:///Users/Greg/Documents/myscript.user.js Line: 1, Column: 1 Source Code: // ==UserScript== </code></pre>
 

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