Skip to content

Instantly share code, notes, and snippets.

@xerxesb
Created February 5, 2012 11:39
Show Gist options
  • Select an option

  • Save xerxesb/1744913 to your computer and use it in GitHub Desktop.

Select an option

Save xerxesb/1744913 to your computer and use it in GitHub Desktop.
Netbank hackery
var BetterNetbank = {
inject: function(table) {
if ($("#" + table).length > 0) {
$('#' + table + ' thead tr').prepend('<th>X</th>');
$('#' + table + 'Body > tr').map(function() {
$(this).prepend('<td><input type="checkbox" /></td>');
});
}
}
}
BetterNetbank.inject('transactionsTable');
BetterNetbank.inject('outstandingAuthorizationsTable');
var theShizzle = function() {
BetterNetbank.inject('transactionsTable');
BetterNetbank.inject('outstandingAuthorizationsTable');
}
var doTheShizzle = function(event) {
document.removeEventListener('DOMSubtreeModified', doTheSizzle,true);
if (event.target.id == "ctl00_BodyPlaceHolder_updatePanelResults" && event.target.innerHtml != "")
theShizzle();
document.addEventListener('DOMSubtreeModified', doTheSizzle,true);
return true;
}
document.addEventListener('DOMSubtreeModified', doTheSizzle,true);
//$('#ctl00_BodyPlaceHolder_btnSearch_field').bind('click', theShizzle);
//$('#ctl00_BodyPlaceHolder_divDetails').bind('DOMAttrModified', theShizzle);
//$('#ctl00_BodyPlaceHolder_updatePanelResults').bind('DOMSubtreeModified', theShizzle);
$(document).bind('DOMSubtreeModified', theShizzle);
var c = $('#ctl00_BodyPlaceHolder_divDetails');
c.__setAttribute = c.setAttribute;
c.setAttribute = function(){
alert('new item added');
c.__setAttribute.apply(c, arguments);
@xerxesb
Copy link
Copy Markdown
Author

xerxesb commented Feb 5, 2012

If the page is just sitting idle, "theShizzle" in the console yields ReferenceError: theShizzle is not defined

If i break into the callback and access theShizzle, it finds the object perfectly well...

@kitgrose
Copy link
Copy Markdown

Just going to record here that the issue was the Chrome Extension sandbox.

@xerxesb
Copy link
Copy Markdown
Author

xerxesb commented Feb 13, 2012

stupid sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment