/usr/share/xul-ext/greasemonkey/modules/processScript.js is in xul-ext-greasemonkey 3.8-1~deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 'use strict';
// Frame scripts, including all their functions, block scopes etc. are
// instantiated for each tab. Having a single per-process script has a lower
// footprint for stateless things. Avoid keeping references to frame scripts
// or their content, this could leak frames!
var EXPORTED_SYMBOLS = ['addFrame'];
// Each (child) process needs to handle navigation to `.user.js` via file://.
Components.utils.import("chrome://greasemonkey-modules/content/installPolicy.js");
// \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ //
function addFrame(frameMM) {
frameMM.addMessageListener("greasemonkey:frame-urls", urlTree);
}
function urlsOfAllFrames(contentWindow) {
var urls = [contentWindow.location.href];
function collect(contentWindow) {
urls = urls.concat(urlsOfAllFrames(contentWindow));
}
Array.from(contentWindow.frames).forEach(collect);
return urls;
}
function urlTree(message) {
var frameMM = message.target;
var urls = urlsOfAllFrames(frameMM.content);
var response = {urls: urls};
frameMM.sendAsyncMessage("greasemonkey:frame-urls", response);
}
|