var DOWebContentGatherer = function() {};

DOWebContentGatherer.prototype = {
    run: function(arguments) {
        // Pass relevant webpage content to the extension.
        arguments.completionFunction({"URL"      : document.baseURI,
                                     "title"     : document.title,
                                     "selection" : window.getSelection().toString().trim()
                                     });
    },
};

// The JavaScript file must contain a global object named "ExtensionPreprocessingJS".
var ExtensionPreprocessingJS = new DOWebContentGatherer;