@Honza: I sent you my code. 

Thanks,
Ebrahim


On Friday, July 26, 2013 3:15:23 PM UTC+2, Jan Honza Odvarko wrote:
>
> On Friday, July 26, 2013 10:22:06 AM UTC+2, Ebrahim wrote:
>>
>>
>>
>> On Thursday, July 25, 2013 5:53:23 PM UTC+2, Jan Honza Odvarko wrote:
>>>
>>>
>>> > The problem comes from the jQuery(context.window.document).ready... 
>>> code. Is something wrong in the code? 
>>> Is your extension source available somewhere?
>>>
>>> Note that you are trying to run jQuery within chrome scope, i.e. where 
>>> Firefox extensions run.
>>> So, it could be potential problem apart from the fact that jQuery must 
>>> be properly included
>>> in your extension scope.
>>>
>>
>> Could you please describe a bit more about this? I just execute a jQuery 
>> statement in my extension on the DOM currently loaded in FF. 
>>
> Since you are using Firebug's |context| object in the expression:
> "jQuery(context.window.document).ready"
>
> I suppose that the expression is executed within chrome scope.
> But, chrome scope doesn't have default access to jQuery -
> even if the current page (a content scope) has it included.
>
> You need to explicitly include jQuery into your extension to
> make it work (but note that I never done that so, not  sure)
> if it works.
>
> You might want to experiment with:
>
> context.addEventListener(win, "load", onLoadHandler, true);
>
> See e.g.
>
> https://github.com/firebug/firebug/blob/master/extension/content/firebug/css/loadHandler.js#L54
>
>  
>
>>  
>>
>>>
>>> Do you see any exceptions?
>>> You could try to enclose the jQuery call in try-catch and see what 
>>> exception could be there...
>>>
>>>
>> I see no exception. Seems the JavaScript engine completely ignores the 
>> jQuery(context.window.document).ready(function().... code line. 
>>
> This sounds weird.
>
> Honza
>
>  
>
>>  
>> Ebrahim
>>
>>>
>>>
>>> On Thursday, July 25, 2013 4:29:33 PM UTC+2, Ebrahim wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I have the following  simple code in my extension: 
>>>>
>>>> --------------------------------------------------
>>>>
>>>> Firebug.CommandLine.evaluate(commandString, Firebug.currentContext, 
>>>> null, null, function(res) {}, function failure() {});
>>>>
>>>> jQuery(context.window.document).ready(function(){
>>>>
>>>>     DO_SOMETHING();
>>>>
>>>> });
>>>>
>>>>
>>>> --------------------------------------------------
>>>>
>>>> the commandString is a JavaScript script that makes a change to the 
>>>> page; it may add new content to the page or change the existing content. I 
>>>> checked and it works.
>>>>
>>>> Then the DO_SOMETHING function extracts the newly added content from 
>>>> the page. The problem is that DO_SOMETHING is not executed. The 
>>>> problem comes from the jQuery(context.window.document).ready... code. Is 
>>>> something wrong in the code? 
>>>>
>>>> Thanks for any help,
>>>> Ebrahim
>>>>
>>>>
>>>>
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/firebug.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/firebug/c1df9f03-09ef-47a7-8c87-d6b2d92d1f43%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to