how to include a js-file into a greasmonkey user scipt?
1,734 views
Skip to first unread message
rittergig
unread,
Aug 6, 2009, 2:15:33 PM8/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to greasemonkey-users
Hi,
Is there a way to include an external js-file into my greasemonkey
scripts?
For example i want to include the toolbox.js.
I tried this way:
---------------------
function include ( JsFile )
{
var elementBody = document.getElementsByTagName('body').item(0);
var script = document.createElement('script');
script.src = JsFile ;
script.type = 'text/javascript';
//alert("1");
elementBody.appendChild(script)
//alert("2");
}
include ("toolbox.js");
------------------------
If i run this script in an normal html-file without gm it works fine.
But if i try this in a gm-script the js file will no be included, even
if i write the complete file name:
"file:///C:/Dokumente und Einstellungen/Peter/Anwendungsdaten/Mozilla/
Firefox/Profiles/***/gm_scripts/google_bilder_links_dire/toolbox.js"
What do i wrong?
Is there a easier and better way?
Thanks.
Anthony Lieuallen
unread,
Aug 6, 2009, 2:20:44 PM8/6/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to greasemon...@googlegroups.com
On 8/6/2009 2:15 PM, rittergig wrote: > Is there a way to include an external js-file into my greasemonkey > scripts?