How to load external greasemonkey script

88 views
Skip to first unread message

Denwer

unread,
Jun 22, 2016, 5:09:37 AM6/22/16
to greasemonkey-users
Hello.

I want to load external greasemonkey scripts, instead of load them locally.
How I can load without store them locally?

For example i have an alert script for google for example which is stored in http://data.com/test.js

// ==UserScript==
// @name        load external script
// @namespace   .
// @include     https://www.google.es/*
// @version     1
// @grant       none
// ==/UserScript==

document.onreadystatechange = () => {
  if (document.readyState === 'complete') {

  // alert('test');

  }
};


Klaus Johannes Rusch

unread,
Jun 22, 2016, 5:18:15 AM6/22/16
to greasemon...@googlegroups.com
On 2016-06-22 11:09, Denwer wrote:
I want to load external greasemonkey scripts, instead of load them locally.
How I can load without store them locally?

For example i have an alert script for google for example which is stored in http://data.com/test.js
You always need a minimal Greasemonkey script installed locally, but you can load the code that actually does the processing using the @require directive in the metadata block:

    https://wiki.greasespot.net/Metadata_Block#.40require

The script will be downloaded from the remote location but stored locally, alongside with the loader script.

-- 
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

Denwer

unread,
Jun 22, 2016, 5:30:22 AM6/22/16
to greasemonkey-users, klaus...@atmedia.net
Hello Klaus,

Thank you. It helped me a lot.

среда, 22 июня 2016 г., 11:18:15 UTC+2 пользователь Klaus Johannes Rusch написал:
Reply all
Reply to author
Forward
0 new messages