Errata

Greasemonkey Hacks

Errata for Greasemonkey Hacks

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
"Preface", "How This Book Is Organized"

The text reads:

" Chapter 2, Linkmania!
The Web revolves around links. Make them work for you! Learn how to control links that try to open a new window, launch unwanted applications, execute JavaScript, or otherwise behave badly. Plus, see how to follow links without clicking.

Chapter 3, Beautifying the Web
The Web revolves around links. Make them work for you! Learn how to control links that try to open a new window, launch unwanted applications, execute JavaScript, or otherwise behave badly. Plus, see how to follow links without clicking."

Obviously the info for chapter 3 is incorrect, and is a copy of the info for chapter 2.

Anonymous  Mar 26, 2016 
Printed Page 22
3rd Paragraph

The 3rd sentence reads: "To access a particular item, you need to call
snapshotResults.snapshotItem(index)."

I think (consistent with the preceding sentence and the following example), the
sentence should read: "To access a particular item, you need to call
snapResults.snapshotItem(index)."

Anonymous   
Printed Page 22
3rd paragraph

Since this errata has been already anonimously submitted (although it still appears as unconfirmed errata), I copy&paste the original detailed description of this minor error:

The 3rd sentence reads: "To access a particular item, you need to call
snapshotResults.snapshotItem(index)."

I think (consistent with the preceding sentence and the following example), the
sentence should read: "To access a particular item, you need to call
snapResults.snapshotItem(index)."


Moreover, I would like to point also the next unconfirmed errata (only 1 page later, number 23). I've noticed both of them just now, and curiously both are still noted as unconfirmed errata.

Daniel Carral  Dec 13, 2010 
Printed Page 23
first code example

The end of the first line reads:

'MZZZZZZZ')",

lacking a necessary closing square bracket. The code in the script it's taken from, Hack #25, instead reads:

'MZZZZZZZ')]",

Anonymous   
Printed Page 339
getLogin() function

The format of bugmenot.com has changed, so the getLogin() function of the bugmenot
script needs changing. The following now works:

function getLogin(uri, usernameInputIndex, passwordInputIndex) {
var usernameField = allInputs[usernameInputIndex];
var pwField = allInputs[passwordInputIndex];
waitOrRestoreFields(usernameField, pwField, false);

var hostUri = location.hostname;

GM_xmlhttpRequest({
method: "get",
headers: null,
data: null,
url: uri,
onload: function(responseDetails) {
waitOrRestoreFields(usernameField, pwField, true);
var doc = textToXml(responseDetails.responseText);
if (!(doc && doc.documentElement)) {
return Errors.say(Errors.malformedResponse);
}

var accountInfo = doc.documentElement.
getElementsByTagName("td");
if (!(accountInfo && accountInfo.length >= 2)) {
return Errors.say(Errors.noLoginAvailable);
}
var userIndex = retrievals == 0 ? 0 : retrievals * 4;
var passIndex = retrievals == 0 ? 1 : retrievals * 5;
if(userIndex > accountInfo.length
|| passIndex > accountInfo.length) { // no more
userIndex = 0; passIndex = 1;
}
usernameField.value = accountInfo[userIndex].firstChild.nodeValue;
pwField.value = accountInfo[userIndex].firstChild.nodeValue;
retrievals++;
},
onerror: function(responseDetails) {
waitOrRestoreFields(usernameField, pwField, true);
Errors.say(Errors.xmlHttpFailure);
}
});
}

Anonymous