/usr/share/xul-ext/greasemonkey/content/scriptprefs.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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | Components.utils.import('chrome://greasemonkey-modules/content/util.js'); // ref'd in XUL
var gScriptId = decodeURIComponent(location.hash.substring(1));
var gScript = GM_util.getService().config.getMatchingScripts(function(script) {
return script && (script.id == gScriptId);
})[0];
var gScriptExcludesEl;
var gScriptMatchesEl;
var gScriptIncludesEl;
var gTabboxEl;
var gUserExcludesEl;
var gUserMatchesEl;
var gUserIncludesEl;
var gUserTabEl;
window.addEventListener('load', function() {
// I wanted "%s" but % is reserved in a DTD and I don't know the literal.
document.title = document.title.replace('!!', gScript.localized.name);
var gTabboxEl = document.getElementsByTagName('tabbox')[0];
gUserTabEl = gTabboxEl.tabs.getItemAtIndex(0);
gUserIncludesEl = document.getElementById('user-includes');
gUserMatchesEl = document.getElementById('user-matches');
gUserExcludesEl = document.getElementById('user-excludes');
gScriptIncludesEl = document.getElementById('script-includes');
gScriptMatchesEl = document.getElementById('script-matches');
gScriptExcludesEl = document.getElementById('script-excludes');
gScriptIncludesEl.pages = gScript.includes;
gScriptIncludesEl.onAddUserExclude = function(url) {
gUserExcludesEl.addPage(url);
gTabboxEl.selectedTab = gUserTabEl;
};
gUserIncludesEl.pages = gScript.userIncludes;
var matchesPattern = [];
for (var i = 0, count = gScript.matches.length; i < count; i++) {
matchesPattern.push(gScript.matches[i].pattern);
}
gScriptMatchesEl.pages = matchesPattern;
var userMatchesPattern = [];
for (var i = 0, count = gScript.userMatches.length; i < count; i++) {
userMatchesPattern.push(gScript.userMatches[i].pattern);
}
gUserMatchesEl.pages = userMatchesPattern;
gScriptExcludesEl.pages = gScript.excludes;
gScriptExcludesEl.onAddUserInclude = function(url) {
gUserIncludesEl.addPage(url);
gTabboxEl.selectedTab = gUserTabEl;
};
gUserExcludesEl.pages = gScript.userExcludes;
}, false);
function onDialogAccept() {
gScript.userIncludes = gUserIncludesEl.pages;
gScript.userMatches = gUserMatchesEl.pages;
gScript.userExcludes = gUserExcludesEl.pages;
GM_util.getService().config._changed(gScript, "cludes");
}
|