Tim Schumacher <[EMAIL PROTECTED]> writes:

> Hi Folks,
> I tried this evening to integrate jQuery into conkeror, so I can use
> it in development of interactive functions and so on. jQuery is
> JavaScript-Framework and follows the "write less, do more"-scheme. I
> could use its features very well in my noscript-gluecode, because I
> want to fetch all <script>-Tags and pare all src-attributes. In jQuery
> I would do something like this: 

> $("script").each(function(){
>   var src = $(this).attr('src'); // this contains the src-domnode
> });

> I found this Komodo-Extension, which adds jQuery to the Chrome as an
> Overlay:

> http://community.activestate.com/xpi/jquery

> I edited the chrome.manifest from

> overlay chrome://komodo/content/conkeror.xul
> chrome://jquery/content/overlay.xul

> to

> overlay chrome://conkeror/content/conkeror.xul
> chrome://jquery/content/overlay.xul

This overlay business is not the right approach for making jQuery
available from Conkeror.  These overlays have the effect of causing
jQuery to be loaded from the context of each window object, presumably
adding a jQuery and a $ member to each such object, when each top-level
window is created.  Conkeror code does not run with the top-level window
object as the global context.  Instead, load jQuery once and ensure that
jQuery gets added as a global variable.  I recommend against using the
global $ identifier, although it is currently not used.

I am, however, skeptical that it will actually prove to be useful in
Conkeror.  Note that you will always need to pass in the relevant
document or other context when using jQuery.

-- 
Jeremy Maitin-Shepard
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to