Hey guys, I've had had many ideas to create and everytime i think of it, this thing stops me..I need an option that lets me select the injection line or something ? i know theres an option to inject on top or bottom but thats not gonna solve it, sometimes i want to edit a javascript function contents and its in middle, it gets called right after it, and if i try to change that function from bottom its useless cus it was already fired, if i tried from top, the middle function will override it,Anyway close solution for this ? i just started using it not sure--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to greasemonkey-us...@googlegroups.com.
To post to this group, send email to greasemon...@googlegroups.com.
Visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
You cannot inject in the middle of JavaScript. JS is single threaded; while it's running no other JS is running. Attempting to change an existing JS function somewhere in the middle is somewhere from very advanced to impossible to do. When it is possible, there is no one recipe answer as to how to make it happen, rather you must really know what you're doing and approach that problem specifically.(You _might_ be able to use document-start and watch [1] or proxies to override definition of the function. But it's still hard/avanced.)
[1] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch
On Mon, Apr 8, 2013 at 10:28 AM, Osama Muhammed <xxvii...@gmail.com> wrote:
Hey guys, I've had had many ideas to create and everytime i think of it, this thing stops me..I need an option that lets me select the injection line or something ? i know theres an option to inject on top or bottom but thats not gonna solve it, sometimes i want to edit a javascript function contents and its in middle, it gets called right after it, and if i try to change that function from bottom its useless cus it was already fired, if i tried from top, the middle function will override it,Anyway close solution for this ? i just started using it not sure
--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to greasemonkey-users+unsub...@googlegroups.com.
but its possible suggestion isn't it ? as i explained, an option that is like // @append-to-line 11that injects my js to that line
You can use 'beforescriptexecute' event
https://developer.mozilla.org/docs/DOM/Mozilla_event_reference/beforescriptexecute
Explanations on http://userscripts.org/scripts/show/125936
On Mon, Apr 8, 2013 at 10:51 PM, Anthony Lieuallen <aran...@gmail.com> wrote:
> On Mon, Apr 8, 2013 at 11:23 AM, Osama Muhammed <xxvii...@gmail.com>
> wrote:
>>
>> but its possible suggestion isn't it ? as i explained, an option that is
>> like // @append-to-line 11
>> that injects my js to that line
>
>
>
> No. I explicitly said that it is not possible. You'd need something
> besides Greasemonkey like perhaps a tampering proxy to do such an action.
>
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to greasemonkey-users+unsub...@googlegroups.com.