[Greasemonkey] access to injected scripts?
Nikolas Coukouma
lists at atrus.org
Sun May 29 04:00:27 EDT 2005
Edward Lee wrote:
>On 5/28/05, Bill Donnelly <donnelly at snowcrest.net> wrote:
>
>
>>I wanted to be able to "see" all injected scripts.
>>
>>
>
>Well.. this seems like it can only be solved with additional GM
>support because GM removes the scripts.
>
>Hackyish... provide a GM_getScripts() [I suppose getSelf could be
>bundled into there where it checks the argument]. The function would
>return an array of all the scripts, but the problem is that it would
>only show the scripts that have been injected so far if the current
>script calls GM_getScript right away.
>
>var allScripts = new Array();
>allScripts.unshift(getContents..) // add to the array the script
>contents when injecting
>window.GM_getScripts = function() { return allScripts; }
>
>As long as the allScripts keeps getting updated, later (delayed
>setTimeout/events) calls to the function will get all the scripts even
>those that ran afterward it.
>
>Actually, a script could call GM_getScripts() right away and the
>contents of the array would have itself at the beginning, so there
>would be no need for a GM_getSelf(). Just do a GM_getScripts()[0] to
>get the script itself. :)
>
>
>
Errrrr, we're adding a feature to list the injected scripts for users.
What do you want to do? cross-script dependencies? Please elaborate on
what you want. A feature without a goal is pure bloat.
-Nikolas Coukouma
More information about the Greasemonkey
mailing list