I sometimes like to convert bookmarklets to interactive functions.

(Easier to modify/extend if it is plain old javascript rather than a
javascript: url.)

The difficulty is in setting up the environment for the interactive
function, so that it sees all of the same variables that it would see if
invoked as a javascript: url, or as a script embedded in the current web
page.

Sometimes this suffices:

    interactive("foo", "The foo bookmarklet as interactive function",
                function foo(I) {

                  var document = I.buffer.document.wrappedJSObject;
                  var window = I.window;

                  ... original code of the foo bookmarklet ...

    });

Sometimes this is not enough.

Anyone know how to set up the environment correctly?

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

Reply via email to